2016-08-16 178 views
2

我真的不知道PHPMailer,Mandrill或我的托管帐户有什么问题。一切工作正常进行最后4个月,但今天我得到这个错误:PHPMailer:一切工作正常4个月,但突然SMTP连接()失败

Message could not be sent.Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

,这里是什么样子时,启用$mail->SMTPDebug = 2;,如:

2016-08-16 15:30:08 SERVER -> CLIENT: 220-jkt03.dewaweb.com ESMTP Exim 4.87 #1 
Tue, 16 Aug 2016 22:30:08 +0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. 2016-08-16 15:30:08 
CLIENT -> SERVER: EHLO komisian.com 2016-08-16 15:30:08 
SERVER -> CLIENT: 250-jkt03.dewaweb.com Hello komisian.com [103.200.7.25] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250-STARTTLS 250 HELP 2016-08-16 15:30:08 
CLIENT -> SERVER: STARTTLS 2016-08-16 15:30:08 
SERVER -> CLIENT: 220 TLS go ahead 2016-08-16 15:30:08 
CLIENT -> SERVER: EHLO komisian.com 2016-08-16 15:30:08 
SERVER -> CLIENT: 250-jkt03.dewaweb.com Hello komisian.com [103.200.7.25] 250-SIZE 52428800 250-8BITMIME 250-PIPELINING 250-AUTH PLAIN LOGIN 250 HELP 2016-08-16 15:30:08 
CLIENT -> SERVER: AUTH LOGIN 2016-08-16 15:30:12 
SERVER -> CLIENT: 334 VXNlcm5hbWU6 2016-08-16 15:30:12 
CLIENT -> SERVER: xxx 2016-08-16 15:30:12 
SERVER -> CLIENT: 334 UGFzc3dvcmQ6 2016-08-16 15:30:12 
CLIENT -> SERVER: xxx== 2016-08-16 15:30:15 
SERVER -> CLIENT: 535 Incorrect authentication data 2016-08-16 15:30:15 
SMTP ERROR: Password command failed: 535 Incorrect authentication data 2016-08-16 15:30:15 SMTP Error: Could not authenticate. 2016-08-16 15:30:15 
CLIENT -> SERVER: QUIT 2016-08-16 15:30:15 
SERVER -> CLIENT: 221 jkt03.dewaweb.com closing connection 2016-08-16 15:30:15 
SMTP connect() failed. 
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Message could not be sent.Mailer Error: SMTP connect() failed. 
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting 

任何想法是什么原因造成这个错误?这是我的托管帐户或Mandrill的错吗?我已经下载了最新版本的PHPMailer,但这就是我得到的结果。

仅供参考,我使用测试本教程:https://mandrill.zendesk.com/hc/en-us/articles/205582147-How-to-Send-with-PHPMailer

谢谢您的回答。对此,我真的非常感激。

+1

问:定期发送多少封电子邮件?如果你觉得你没有派出太多,那么考虑设立一个SPF记录。这可能会减少这种可能性。 –

+0

只是为了确保:您是否有付费SurveyMonkey帐户? [Mandrill今年早些时候与支付的SurveyMonkey账户挂钩](http://blog.mandrill.com/important-changes-to-mandrill.html)。我不知道他们的滚动过程是什么样的,但是您的非付费帐户可能已停用... – Chris

回答

1

它出现在您的托管公司可能已经改变了他们传出的电子邮件政策或收紧了垃圾邮件过滤:

ESMTP Exim 4.87 #1 Tue, 16 Aug 2016 22:30:08 +0700 220- We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.

否则,你碰巧最近更改密码?

SERVER -> CLIENT: 535 Incorrect authentication data 2016-08-16 15:30:15
SMTP ERROR: Password command failed: 535 Incorrect authentication data
2016-08-16 15:30:15 SMTP Error: Could not authenticate. 2016-08-16 15:30:15

+0

感谢您的回答,兄弟。我会联系我的托管公司。 –

+0

这只是一个普通的欢迎横幅,从技术上讲这并不意味着什么。 – Synchro

+0

@Synchro,够公平的,尽管这并不排除这种可能性,尤其是因为我们不知道之前是否存在这样的信息。 –

1
SMTP ERROR: Password command failed: 535 Incorrect authentication data 2016-08-16 15:30:15 SMTP Error: Could not authenticate. 2016-08-16 15:30:15 

不管是什么,它关系到认证数据 - 仔细检查用户名/密码。

The whole 53x group of SMTP errors指用户名为&的密码。

RFC 4954介绍535 Authentication credentials invalid

This response to the AUTH command indicates that the authentication failed due to invalid or insufficient authentication credentials. In this case, the client SHOULD ask the user to supply new credentials (such as by presenting a password dialog box).

2

假设你建立你的脚本跟山魈(即设置$mail->Host = 'smtp.mandrillapp.com';,按照您链接到那个例子),但是请注意你连接到jkt03.dewaweb.com,这不是mandrill服务器(它看起来像在印度尼西亚,因为你的域名也是如此),所以我猜你的ISP会透明地将你重定向到他们自己的邮件服务器,当然你的mandrill凭证不起作用。

他们很可能改变了他们的出站电子邮件政策,导致这个问题。这是很常见的 - GoDaddy做到这一点,这里有几十亿个问题。

如果你之前5.6运行PHP,或有残疾TLS证书验证(如PHPMailer的文档描述了),无法检测到这种情况的发生,这就是为什么你不应该禁用它!这意味着你已经向你的ISP发放了你的mandrill证书 - 他们实际上正在对你进行一次中间人攻击!

我编辑了您的SMTP输出,因为它包含不受保护的密码。

+0

顺便说一下,该mandrill示例已过时,并且不会与去年左右的PHPMailer一起使用。 – Synchro