简体   繁体   English

通过Java Mail API发送邮件时收到套接字重置错误

[英]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. JavaMail调试输出可能会提供更多线索,但是如果您真的想知道原因,很可能需要进行一些底层网络调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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