hymailer/mailerqueue

HY 异步邮件投递队列

安装: 1

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:yii2扩展

v0.0.1 2018-12-04 01:48 UTC

This package is not auto-updated.

Last update: 2024-10-03 03:35:15 UTC


README

HY 异步邮件投递队列

安装

安装此扩展的首选方式是通过composer。

运行

php composer.phar require --prefer-dist hymailer/mailerqueue

将此命令添加到你的composer.json文件中的require部分。

配置

要使用此扩展,您必须配置应用配置中的Connection类

return [ //....

'components' => [
    'mailer' => [

        // 'class' => 'yii\swiftmailer\Mailer',
        // 指向自定义的扩展类名(继承yii\swiftmailer\Mailer) 加载时无法识别自定义的目录 需要在前面alias声明

        'class' => 'hymailer\mailqueue\QueueMailer',

        // send all mails to a file by default. You have to set
        // 'useFileTransport' to false and configure a transport
        // for the mailer to send real emails.

        'db'  => '1', //redis默认有16个库,这里选择入第2个库
        'key' => 'mails',  //redis键名
        'useFileTransport' => false,
        'transport' => [
            'class' => 'Swift_SmtpTransport',
            'host' => 'smtp.163.com',
            'username' => 'imooc_shop@163.com',
            'password' => 'imooc123',
            'port' => '465',
            'encryption' => 'ssl',
        ],
    ],
]

];