wodrow 2016-03-29 15:11:00 11021次浏览 1条评论 6 3 0

参考yii2 邮件发送

在开放qq邮箱的smtp后使用qq邮箱地址和qq密码配置服务器后会出现错误

Failed to authenticate on SMTP server with username "1173957281" using 1 possible authenticators

经查看资料得知需要用qq授权吗 参考qq邮箱帮助中心

配置mail

'transport' => [
    'class' => 'Swift_SmtpTransport',
    'host' => 'smtp.qq.com',  //每种邮箱的host配置不一样 用的qq邮箱
    'username' => '1173957281@qq.com',
    'password' => 'pbjkxe*****wibfe', // 十六位授权码
    'port' => '465',
    'encryption' => 'ssl',
],
'messageConfig'=>[
    'charset'=>'UTF-8',
    'from'=>['1173957281@qq.com'=>'admin']
],

并且你需要配置你的params[common/config/params.php]配置文件中的supportEmail

return [
    'adminEmail' => '1173957281@qq.com',
    'supportEmail' => '1173957281@qq.com',
    'user.passwordResetTokenExpire' => 3600,
];

要不会出现邮箱地址不匹配问题

觉得很赞
您需要登录后才可以评论。登录 | 立即注册