xgnic 发表于 2018-2-11 11:54:28


            前言
本文主要介绍的是关于解决Yii2邮件发送返回成功但接收不到邮件问题的相关内容,分享出来供大家参考学习,下面来看看详细的介绍:
刚刚用了一下yii邮件发送功能,虽然结果返回成功,但接收不到邮件。
配置文件代码如下:
'components' => [
'db' => [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=localhost;dbname=yiidemo',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
],
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// 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' => true,
'transport' => [
   'class' => 'Swift_SmtpTransport',
   'host' => 'smtp.qq.com',
   'username' => '********@qq.com',
   'password' => '********',
   'port' => '465',
   'encryption' => 'ssl',
],
],
],
页: [1]
查看完整版本: 解决Yii2邮件发送结果返回成功,但接收不到邮件的问题