How can I re-initialize JavaMail environment in a servlet before actual sending e-mail?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sergey_Ushakov
Posted On:   Saturday, May 19, 2001 03:07 AM

I use JavaMail for sending SMTP mail from a servlet with TomCat. All works fine if my ISP connection was on when the servlet was launched. Otherwize the servlet somehow remembers that there was no Internet connection and no DNS on startup and rejects all subsequent Transport.send() requests with: javax.mail.SendFailedException: Sending failed; nested exception is: javax.mail.MessagingException: Unknown SMTP host: smtp.myprovider.com; nested exception is: java.net.UnknownHostException: smtp.myprovider.com at javax.mail.Transport.send0(Transport.java:219) at javax.mail.Transport.send(Transport.java:81) ... - even when Internet connection is already availa   More>>

I use JavaMail for sending SMTP mail from a servlet with TomCat. All works fine if my ISP connection was on when the servlet was launched.

Otherwize the servlet somehow remembers that there was no Internet connection and no DNS on startup and rejects all subsequent Transport.send() requests with:

			
javax.mail.SendFailedException: Sending failed;
nested exception is:
javax.mail.MessagingException: Unknown SMTP host: smtp.myprovider.com;
nested exception is:
java.net.UnknownHostException: smtp.myprovider.com
at javax.mail.Transport.send0(Transport.java:219)
at javax.mail.Transport.send(Transport.java:81)
...


- even when Internet connection is already available.

How can I re-initialize the JavaMail environment before actual sending e-mail? Or maybe handle some possible notifications from underlying TCP/IP system?    <<Less

Re: How can I re-initialize JavaMail environment in a servlet before actual sending e-mail?

Posted By:   John_Zukowski  
Posted On:   Saturday, May 19, 2001 11:35 AM

Try checking the Networking FAQ as it is really a question unrelated to JavaMail. Not sure if the answer is there, but that is the more appropriate place to get the real question answered.... How do I invalidate the DNS cache after the network connection status changes.... or something like that.
About | Sitemap | Contact