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 the JavaMail API, you could try sending an email and seeing if it was sent successfully.
From a connectivity standpoint, you could just ping it:
InetAddress host = InetAddress.getByName("mailserver"); System.out.println("host.isReachable(1000) = " + host.isReachable(1000));