开发者

How to connect smtp port 25 in second time?

开发者 https://www.devze.com 2023-02-21 03:32 出处:网络
I am using Apache commons mail to send mail in my web application. My web application is hosted in Tomcat. When I try to send mail for the first time after server starts. I am able to send mail. But a

I am using Apache commons mail to send mail in my web application. My web application is hosted in Tomcat. When I try to send mail for the first time after server starts. I am able to send mail. But after that, when I attempted second time, it is not connecting to SMTP port 25.

By using setDebug(true);, I could able to find that after emailObj.send(), it closes the connection. So then it couldn't connect next ti开发者_C百科me.

How to resolve my issue?


Are you reusing the same Email instance ?

Email is a class representing one Email, which you will sent through send() method.

If you want to send another email, you have to instantiate a new Email object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号