yii 框架用swiftmailer 发送邮件
来源:互联网 发布:淘宝天天特价规则 编辑:程序博客网 时间:2024/05/16 17:49
1.先在配置文件中 config/web.php 中修改配置文件
'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', // 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. 'useFileTransport' => false, //'class' => 'yii\swiftmailer\Mailer', 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.163.com', 'username' => 'm18612193548@163.com', 'password' => 'n1234567890', 'port' => '25', 'encryption' => null, ], 'messageConfig'=>[ 'charset'=>'UTF-8', 'from'=>['m18612193548@163.com'=>'admin'] ],],
2 。在控制器里加入以下代码进行测试
Yii::$app->mailer->compose() ->setFrom('m18612193548@163.com') ->setTo('1297192749@qq.com') ->setSubject('Message subject') ->setTextBody('Plain text content') ->setHtmlBody('<b>傻蛋</b>') ->send();
0 0
- yii 框架用swiftmailer 发送邮件
- yii 框架用swiftmailer 发送邮件
- PHP发送邮件swiftMailer
- Yii框架发送邮件
- yii 框架 发送邮件
- Yii框架发送邮件
- yii框架邮件发送
- yii框架中的邮件发送
- Yii 框架邮件的发送
- Yii框架的邮件发送
- 用yii发送邮件
- thinkphp 整合 swiftmailer 实现邮件发送
- Thinkphp整合swiftmailer实现邮件发送
- 高效的PHP邮件发送库:Swiftmailer
- 使用yii框架实现邮件发送
- YII2 邮件插件SwiftMailer使用SendMail本地邮件服务器发送
- yii2.0利用yii2-swiftmailer扩展发送邮件
- YII邮件发送
- mac terminal终端打开指定文件夹 当前文件夹打开terminal
- Android学习笔记02——OKHttp网络框架01
- 欢迎使用CSDN-markdown编辑器
- PAT乙级练习题B1038. 统计同成绩学生
- ATOM基础教程一ATOM代码片段snippets(7)
- yii 框架用swiftmailer 发送邮件
- 约瑟夫环问题
- ccnuacm
- 在linux编程中,以下哪个TCP的套接字选项与nagle算法的开启和关闭有关?----腾讯2016研发工程师在线模拟笔试题
- 指定多个泛型类型
- 引入sys/timeb.h后,timeb can not be resolved
- C++多态实现机制剖析
- SpringMVC中使用Interceptor拦截器
- ArrayList与HashSet的比较,以及HashCode分析, 内存泄露