用apache commons-email 发送大量邮件时报异常
发布网友
发布时间:2022-04-24 00:44
我来回答
共2个回答
热心网友
时间:2023-10-16 04:48
可能是线程堵塞引起异常,导致其他邮件没有正常发送。
建议使用多线程同步,这样安全些
祝lz成功
热心网友
时间:2023-10-16 04:48
您好 我也写邮件发送 但报出异常:
Sending the email to the following server failed : smtp.sina.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242)
at org.apache.commons.mail.Email.send(Email.java:1267)
at com.rd.client.view.tms.TestEmail.main(TestEmail.java:34)
Caused by: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Converting attachment data failed)
at javax.mail.Transport.send(Transport.java:163)
at javax.mail.Transport.send(Transport.java:48)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232)
... 2 more
Caused by: javax.mail.MessagingException: Converting attachment data failed
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:231)
at javax.mail.Transport.send(Transport.java:95)
... 4 more
请问是什么原因呀?
热心网友
时间:2023-10-16 04:48
可能是线程堵塞引起异常,导致其他邮件没有正常发送。
建议使用多线程同步,这样安全些
祝lz成功
热心网友
时间:2023-10-16 04:48
您好 我也写邮件发送 但报出异常:
Sending the email to the following server failed : smtp.sina.com:25
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1242)
at org.apache.commons.mail.Email.send(Email.java:1267)
at com.rd.client.view.tms.TestEmail.main(TestEmail.java:34)
Caused by: javax.mail.SendFailedException: Send failure (javax.mail.MessagingException: Converting attachment data failed)
at javax.mail.Transport.send(Transport.java:163)
at javax.mail.Transport.send(Transport.java:48)
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1232)
... 2 more
Caused by: javax.mail.MessagingException: Converting attachment data failed
at com.google.appengine.api.mail.stdimpl.GMTransport.sendMessage(GMTransport.java:231)
at javax.mail.Transport.send(Transport.java:95)
... 4 more
请问是什么原因呀?