您的位置:首页 > 编程语言 > Go语言

Expected response code 220 but got code “”, with message “””

2017-04-06 12:26 826 查看
在使用swift_mailer时出现了以下错误:

Expected response code 220 but got code "", with message """

解决办法:

这个一般是由于encyption配置导致的

Secure Sockets Layer (SSL)

Transport Layer Security (TLS)
'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' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.163.com',
'username' => 'jiaowomrwei@163.com',
'password' => 'xxxxxxxxx',
'port' => '25',
'encryption' => 'tls',
],
],


再看看163的SMTP配置说明



所以如果使用ssl端口则encyption配置项必须为465/994如果使用非ssl则应该使用25
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐