org.apache.commons.mail.EmailException: Sending the email to the following server failed : www.*.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1469)
at org.apache.commons.mail.Email.send(Email.java:1496)
Caused by: javax.mail.SendFailedException: Invalid Addresses;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT ([email protected]) dosn't exist
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT ([email protected]) dosn't exist
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1294)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:635)
at javax.mail.Transport.send0(Transport.java:189)
at javax.mail.Transport.send(Transport.java:118)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459)
... 34 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT ([email protected]) dosn't exist
;
nested exception is:
com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT ([email protected]) dosn't exist
at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1192)
... 38 more
Caused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT ([email protected]) dosn't exist
... 39 more
解决方案标签:java,收件人,sun,smtp,126,mail,com,邮件 From: https://blog.51cto.com/u_15785215/6035847
} catch (MalformedURLException | EmailException | UnsupportedEncodingException e) {
Throwable cause = e.getCause();
Address[] invalidAddresses = ((SendFailedException) cause).getInvalidAddresses();
结果是:[email protected],[email protected]
查出来后在程序中替换