項目中使用發送郵件時報上述錯誤,去163官網下載javamail的源碼調試。
調試后發現,出上述錯誤的根本原因是,SMTPTransport在做mailfrom的時候,服務器返回錯誤提示消息:
DEBUG SMTP: got response code 550, with response: 550 RP:TRC 163 smtp14,
報錯信息如下:
RSET
DEBUG SMTP: EOF: [EOF]
javax.mail.MessagingException: [EOF]
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1481)
at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1512)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:1054)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:634)
一開始都是屬於正常,但是突然就不能發送郵件了
后來去官網發現:
http://help.163.com/09/1224/17/5RAJ4LMH00753VB8.html
可能是因為發送太頻繁了,導致出現這樣子錯誤。切換了一個郵箱以后就好了