我在AWS EC2 Linux服务器上安装了PHPMailer,无法使用IsSMTP发送邮件(我需要此协议)。我的PHPMailer错误报告如下:

2017-04-21 18:41:15 Connection: opening to just60.justhost.com:465, timeout=300, options=array ()
2017-04-21 18:41:15 Connection: opened
2017-04-21 18:46:15 SMTP -> get_lines(): $data is ""
2017-04-21 18:46:15 SMTP -> get_lines(): $str is  ""
2017-04-21 18:46:15 SMTP -> get_lines(): timed-out (300 sec)
2017-04-21 18:46:15 SERVER -> CLIENT:
2017-04-21 18:46:15 CLIENT -> SERVER: EHLO mydomain.com
2017-04-21 18:46:15 SMTP -> get_lines(): $data is ""
2017-04-21 18:46:15 SMTP -> get_lines(): $str is  ""
2017-04-21 18:46:15 SERVER -> CLIENT:
2017-04-21 18:46:15 SMTP ERROR: EHLO command failed:
2017-04-21 18:46:15 SMTP NOTICE: EOF caught while checking if connected
2017-04-21 18:46:15 Connection: closed
2017-04-21 18:46:15 SMTP Error: Could not authenticate.
2017-04-21 18:46:15 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

{"error":"Email error: SMTP connect() failed. https:\/\/github.com\/PHPMailer\/PHPMailer\/wiki\/Troubleshooting"
}


使用其他协议(IsSendmail和IsMail),但所有协议都可以正常工作,但因某些原因超时的IsSMTP不能正常工作。

所有传出端口均已打开,已安装Postfix和SELinux(SELinux未启用强制功能)。似乎它总是在5分钟后超时,因此“开放连接”数据没有消失,或者数据没有恢复回来,但是为什么呢?

我尝试使用gmail帐户从安全的https网站运行它,但出现以下错误:

2017-04-22 17:00:40 Connection: opening to smtp.gmail.com:465, timeout=300, options=array (
                                      )
2017-04-22 17:00:40 Connection: opened
2017-04-22 17:00:50 SMTP -> get_lines(): $data is ""
2017-04-22 17:00:50 SMTP -> get_lines(): $str is  ""
2017-04-22 17:00:50 SERVER -> CLIENT:
2017-04-22 17:00:50 SMTP NOTICE: EOF caught while checking if connected
2017-04-22 17:00:50 Connection: closed
2017-04-22 17:00:50 SMTP Error: Could not authenticate.
2017-04-22 17:00:50 SMTP connect() failed.

最佳答案

如果这是您首次在此AWS账户上设置SES,则可能处于沙盒模式。

这些限制适用于:


您只能将邮件发送到Amazon SES邮箱模拟器以及已验证的电子邮件地址和域
您只能从经过验证的电子邮件地址和域发送邮件
每24小时最多可发送200条消息
Amazon SES每秒最多可以从您的帐户接受一条消息


AWS SES Sandbox

您需要在AWS中提交支持票证才能退出沙箱。

关于php - AWS Linux服务器上的PHPMailer超时,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/43550230/

10-15 01:28
查看更多