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.
From this Link; you can use the following logic:
public boolean isAlive() throws MessagingException { session.setDebug(true); Transport transport = session.getTransport("smtp"); transport.connect(); if (transport.isConnected()) { transport.close(); return true; } return false; }