1. 程式人生 > >郵件發送失敗問題:Sending the email to the following server failed : smtp.qiye.163.com:25

郵件發送失敗問題:Sending the email to the following server failed : smtp.qiye.163.com:25

其他 授權 exc bsp java 發送 dmi sendemail fail

[郵件發送錯誤] : Sending the email to the following server failed : smtp.qiye.163.com:25, {}
org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.qiye.163.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421) ~[commons-email-1.4.jar:1.4]
at org.apache.commons.mail.Email.send(Email.java:1448) ~[commons-email-1.4.jar:1.4]

搜羅網上眾多高手經驗,普遍有三個原因:

1.是端口寫錯了,但是我的端口 沒有寫錯sendemail.setHostName("smtp.163.com");

2是沒有開通驗證,但是我上個星期已經開通過了,而且用 的時候也很順利。

3.就是密碼錯了(或者授權密碼)。我登錄163郵箱查看,沒有問題!

以上3中均不能解決,並且錯誤也沒有明確的提示(code等錯誤碼)。

逐步分析,

mail.hostName,
mail.from.user,
mail.from.pwd,
mail.to.user

只可能收件人部分能夠出現異常。

最後問題所在:有一位收件人郵箱已失效,刪除即可

具體其他的排查方法,HtmlEmail是否有提供錯誤碼Code的分類,繼續摸索!

郵件發送失敗問題:Sending the email to the following server failed : smtp.qiye.163.com:25