我在AWS EC2 Linux服務器上有PHPMailer,無法使用IsSMTP發送郵件(我需要此協議)。我PHPMailer的錯誤報告如下:AWS Linux服務器上的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 &伊斯梅爾),但不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.
看起來您的郵件信用不正確。 – meun5
它實際上並沒有嘗試登錄。我懷疑AWS會默認阻止出站SMTP。您可以使用PHPMailer疑難解答指南中顯示的命令輕鬆測試它,所以在嘗試處理PHP級別的東西之前就可以做到這一點。 – Synchro
我已經做了一些更多的測試。 服務器不是HTTPS(有一個很好的理由) 當TLS/SSL掛起5分鐘時不安全,某些SMTP服務器正常,其他人發出錯誤「我們不授權使用此係統傳輸未經請求的」 似乎掛起是由於TLS/SSL –