发送QQ SMTP邮件遇到发送者邮箱必须与认证邮箱不一致的问题 [ 2.0 版本 ]
Expected response code 250 but got code "501", with message "501 mail from address must be same as authorization user
"
501 发件人邮箱必须与认证帐号相同
太空飞船
注册时间:2012-03-23
最后登录:2016-05-22
在线时长:10小时37分
最后登录:2016-05-22
在线时长:10小时37分
- 粉丝6
- 金钱550
- 威望30
- 积分950
共 1 条评论
yes! must be the same.
You can config like this, then you don't need to set mail from when send mails.
'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'useFileTransport' => false,//set this property to false to send mails to real email addresses //comment the following array to send mail using php's mail function 'transport' => [ 'class' => 'Swift_SmtpTransport', 'host' => 'smtp.yeah.net', 'username' => 'flyfame@yeah.net', 'password' => 'ddd', 'port' => '587', 'encryption' => 'ssl', ], 'messageConfig' => [ 'charset' => 'UTF-8', 'from' => ['flyfame@yeah.net'=>'系统邮件'], ], ],