dev-master
9999999-dev使用队列异步发送邮件.
MIT
The Requires
by zangsilu
yii2 redis mailer async
1.0.0
1.0.0.0使用队列异步发送邮件.
MIT
The Requires
by zangsilu
yii2 redis mailer async
使用队列异步发送邮件.
使用队列异步发送邮件
v1.0.0
, (*1)
composer require zangsilu/yii2-mailer-queue
<?php 'components' => [ 'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => '127.0.0.1', 'port' => 6379, 'database' => 0, ], /* 邮件发送设置 */ 'mailer' => [ 'class' => 'zangsilu\mailerqueue\MailerQueue', 'redisDB'=>1,//使用redis1号库存储邮件队列 'useFileTransport' => false, //必须改为false,true只是生成邮件在runtime文件夹下,不发邮件 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.163.com', 'username' => '', 'password' => '', 'port' => '465',//端口25对应tls协议 端口465对应ssl协议 'encryption' => 'ssl', ], ], ];
<?php namespace app\commands; use Yii; use yii\console\Controller; class MailerQueueController extends Controller { /** * 发送redis队列中的邮件 * php yii mailer-queue/send */ public function actionSend() { $mailer = Yii::$app->mailer; $mailer->process(); echo '发送完毕!'; } }
crontab -e */1 * * * * php yii mailer-queue/send > ./log/mailer-send.log
MIT, (*2)
使用队列异步发送邮件.
MIT
yii2 redis mailer async
使用队列异步发送邮件.
MIT
yii2 redis mailer async