简体   繁体   中英

getting an socket reset error while sending a mail through java mail api

我已经编写了一个Java程序来发送邮件,并且工作正常,但有时会出现此错误,请告知该错误的原因以及如何克服此错误

javax.mail.StoreClosedException: * BYE JavaMail Exception: java.net.SocketException: Connection reset

Networks fail , you need to be prepared to handle it.

Why exactly it's failing in this case is hard to say. The server could be closing the connection because it's overloaded. Your firewall could be closing the connection because it's out of resources. Your router could be failing. The list goes on and on.

The JavaMail debug output might provide more clues, but most likely you'll need to do some low level network debugging if you really want to know why.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM