定制 bitcko/yii2-bitcko-mailer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitcko/yii2-bitcko-mailer

Composer 安装命令:

composer require bitcko/yii2-bitcko-mailer

包简介

Bitcko Yii2 PHPMailer use to send emails from your project.

README 文档

README

Bitcko Yii2 PHPMailer use to send emails from your project.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require bitcko/yii2-bitcko-mailer:dev-master

or add

"bitcko/yii2-bitcko-mailer": "dev-master"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

  1. Mailer configuration in config/web.php for basic temp or config/main.php for advanced.
<?php
'components'=> [
    ...
'BitckoMailer'=>[
            'class'=>'bitcko\mailer\BitckoMailer',
            'SMTPDebug'=> 2, // 0 to disable, optional
            'isSMTP'=>true, // default true
            'Host'=>'smtp.gmail.com', //optional
            'SMTPAuth'=>true, //optional
            'Username'=>'you google account username', //optional
            'Password'=>'your google account password', //optional
            'SMTPSecure'=>'tls', //optional, tls or ssl
            'Port'=>587, //optional, smtp server port
            'isHTML'=>true, // default true
        ],
            ...
        ]
  1. Controller example:
<?php

namespace app\controllers;

use Yii;

use yii\web\Controller;

class SiteController extends Controller
{
   
  public function actionSend()
     {
 
 
         $params = [
             'from'=>['address'=>'email address','name'=>'name here'],
             'addresses'=>[
                 ['address'=>'email address','name'=>'name here']
             ],
             'body'=>'email body here',
             
              //optional              
              'subject'=>'email subject here',
               //optional
              'altBody'=>'email alt body here',
               //optional
              'addReplyTo'=>[
                  ['address'=>'email address','information'=>'info here']
              ],
               //optional
              'cc'=>[
                  'email address'
              ],
               //optional
              'bcc'=>[
                  'email address'
              ],
              //optional
              'attachments'=>[
                 // ['path'=>'','name'=>'']
              ],
         ];
         
         return Yii::$app->BitckoMailer->mail($params); // return true if mail sent successfully
 
     }
}

统计信息

  • 总下载量: 1.63k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-07-09