mirakhamidov / yii2-mail
通过核心邮件发送和记录电子邮件的便捷模块
0.3.2
2021-03-28 18:28 UTC
Requires
- php: >=5.4.0
- mirkhamidov/yii2-alert-autohide: dev-master
- yiisoft/yii2: ^2.0
- yiisoft/yii2-bootstrap: ~2.0.0
- yiisoft/yii2-swiftmailer: ~2.0.0
README
TODO:添加描述
安装
安装此扩展的首选方式是通过 Composer。
运行以下命令之一:
composer require mirkhamidov/yii2-mail "*"
或者将以下内容添加到您的 composer.json
文件的 require 部分中:
"mirkhamidov/yii2-mail": "*"
使用方法
发送带附件的电子邮件
$_mailRecipient = 'you@email.com'; $_mailMoreData = [ 'someParamInEmail' => 'will be replaced with this text', ]; $_mailParams['attach'] = [ [ 'file' => $model->params['file']['fileFullPath'], 'params' => [ // for details look at https://yiiframework.cn/doc-2.0/yii-mail-messageinterface.html#attach()-detail ], ], ]; MMail::sendMail($_mailAlias, $_mailRecipient, $_mailMoreData, $_mailParams);