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 time.
How to resolve my issue?