邮件发送失败问题: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, {}
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的分类,继续摸索!

原文地址:https://www.cnblogs.com/tainshi/p/8203500.html