Is there a way with JavaMail API to check that the mail server used is alive ? If not, how do to it with Java code ?
Thanks by advance for your help.
If you've got a reference to a Session instance, you could do the following:
Session s = //a JavaMail session I got from somewhere boolean isConnected = s.getTransport("smtp").isConnected();
If the mail client is connected to the appropriate SMTP server, it usually means it's alive.