2017 © Pedro Peláez
 

yii2-extension mailerqueue

The Async mailer for the Yii framework

image

jsoma/mailerqueue

The Async mailer for the Yii framework

  • Wednesday, November 29, 2017
  • by TanChungui
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2_redis_mailerqueue

yii2 redis async mailer, (*1)

基于 Redis的邮件异步发送工具, (*2)

1.config.php, (*3)

'aliases' => [ '@jsoma/mailer'=>'@vendor/jsoma/mailerqueue/src' ],, (*4)

'components' => [ ... 'redis' => [ 'class' => 'yii\redis\Connection', 'hostname' => 'localhost', // ip/127.0.0.1 'port' => 6379, 'database' => 0, ],, (*5)

   ...

    'mailer' => [
        //redis 发送邮件
         'class' => 'jsoma\mailer\MailerQueue',
         'db' => '1', // redis select 1
         'key' => 'mails', // redis key
        'useFileTransport' => false,
        'transport' => [
            'class' => 'Swift_SmtpTransport',
            'host' => 'smtp.163.com',
            'username' => 'xxx@163.com',
            'password' => 'xxx',
            'port' => '465',
            'encryption' => 'ssl',
        ],
    ], 
],
  1. mail to redis, (*6)

    $mailer = Yii::$app->mailer->compose($template, $param=[]);//邮件体 $mailer->setFrom('xxx@163.com'); //发件人 $mailer->setTo('xxx@xxx.com'); // 收件人 $mailer->setSubject('xxx'); // 邮件标题 //if ($mailer->send()) { // if ($mailer->queue()) { // redis 发送 return true; }else{ return false; }, (*7)

  2. Send mail by redis ( linux crontab 定时脚本), (*8)

    $mailer = new \jsoma\mailer\MailerQueue(); $mailer->process();, (*9)

The Versions

29/11 2017

dev-master

9999999-dev

The Async mailer for the Yii framework

  Sources   Download

MIT

The Requires

 

by Jsoma

yii2 redis mailer async