PHP code example of windwork / mailer

1. Go to this page and download the library: Download windwork/mailer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

windwork / mailer example snippets


namespace wf\mailer;

/**
 * 发送邮件接口
 *
 * @package     wf.mailer
 * @author      cm <[email protected]>
 * @link        http://docs.windwork.org/manual/wf.mailer.html
 * @since       0.1.0
 */
interface MailerInterface 
{
    /**
     * 发送邮件
     * 
     * @param string $to 收件邮箱
     * @param string $subject  邮件主题
     * @param string $message  邮件内容
     * @param string $from = ''  发件邮箱,留空则使用配置中的邮箱账号
     * @param string $cc = '' 抄送,每个邮件用半角逗号隔开
     * @param string $bcc = ''  密送,每个邮件用半角逗号隔开
     * @return bool
     * @throws \wf\mailer\Exception
     */
    public function send($to, $subject, $message, $from = '', $cc = '', $bcc = '');
}