Java Mail timeout & connectiontimeout handling
Posted
by Gnanam
on Stack Overflow
See other posts from Stack Overflow
or by Gnanam
Published on 2010-05-05T12:26:19Z
Indexed on
2010/05/05
12:28 UTC
Read the original article
Hit count: 292
Hi,
I'm using JavaMail to send email requests to an SMTP server.
I would like to set both "mail.smtp.connectiontimeout" and "mail.smtp.timeout" properties within my code.
Programmatically, I want to catch both when timeout and/or connectiontimeout operations are reached in Java and handle things accordingly. Handling in the sense, I need to retry the same email once again the next time.
How do I handle this in Java/JavaMail? Is it possible to catch & handle this timeout operations?
© Stack Overflow or respective owner