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?
Also, is it possible to simulate/reproduce this timeout operation on my own assuming I've complete administration access to the SMTP server?