Java邮件发送时多个发件人显示,收件人地址有误怎么办?

2026-05-23 21:421阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计271个文字,预计阅读时间需要2分钟。

Java邮件发送时多个发件人显示,收件人地址有误怎么办?

发送邮件至以下服务器失败:www.*.com:25。错误信息来自org.apache.commons.email.EmailException异常,发生在Email.java文件的第1469行,调用sendMimeMessage方法,并在第1496行调用send方法。

Java邮件发送时多个发件人显示,收件人地址有误怎么办?

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 (l1@126.com) dosn't exist; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l1@126.com) 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 moreCaused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l2@126.com) dosn't exist; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l2@126.com) dosn't exist at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1192) ... 38 moreCaused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (luo1@goodbaby.com) dosn't exist ... 39 more

解决方案} catch (MalformedURLException | EmailException | UnsupportedEncodingException e) { Throwable cause = e.getCause(); Address[] invalidAddresses = ((SendFailedException) cause).getInvalidAddresses(); 结果是:l1@126.com,l2@126.com 查出来后在程序中替换

本文共计271个文字,预计阅读时间需要2分钟。

Java邮件发送时多个发件人显示,收件人地址有误怎么办?

发送邮件至以下服务器失败:www.*.com:25。错误信息来自org.apache.commons.email.EmailException异常,发生在Email.java文件的第1469行,调用sendMimeMessage方法,并在第1496行调用send方法。

Java邮件发送时多个发件人显示,收件人地址有误怎么办?

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 (l1@126.com) dosn't exist; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l1@126.com) 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 moreCaused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l2@126.com) dosn't exist; nested exception is: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (l2@126.com) dosn't exist at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1192) ... 38 moreCaused by: com.sun.mail.smtp.SMTPAddressFailedException: 554 RCPT (luo1@goodbaby.com) dosn't exist ... 39 more

解决方案} catch (MalformedURLException | EmailException | UnsupportedEncodingException e) { Throwable cause = e.getCause(); Address[] invalidAddresses = ((SendFailedException) cause).getInvalidAddresses(); 结果是:l1@126.com,l2@126.com 查出来后在程序中替换