swiftmailer 用163发邮件一直报错554 [ 2.0 版本 ]
邮件配置:
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
'messageConfig' => [
'charset' => 'UTF-8',
'from' => ['xxxx@163.com' => 'admin']
],
// 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,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.163.com',
'username' => 'xxxx@163.com',
'password' => '授权码',
'port' => '25',
'encryption' => 'tls'
],
],
发送邮件:
$from = "xxxx@163.com";
$to = "xxxx@qq.com";
$subject = "丽美国际";
$body = "给你发的测试邮件";
$mailer = Yii::$app->mailer->compose();
$mailer->setFrom($from);
$mailer->setTo($to);
$mailer->setSubject($subject);
$mailer->setHtmlBody($body);
$status = $mailer->send();
报错如下:
Expected response code 250 but got code "554", with message "554 DT:SPM
查看网易的说明是如下:
554 DT:SPM 发送的邮件内容包含了未被许可的信息,或被系统识别为垃圾邮件。请检查是否有用户发送病毒或者垃圾邮件;
但是我如果用qq发邮件确实成功的,网易却一直包这个错误,有遇到的吗?
齐天大圣 补充于 2017-09-04 16:06
这个应该没问题吧,因为按照这样设置qq邮箱是没问题
共 3 个回答
齐天大圣 北京
注册时间:2016-02-24
最后登录:2020-06-05
在线时长:18小时30分
最后登录:2020-06-05
在线时长:18小时30分
- 粉丝6
- 金钱550
- 威望0
- 积分730