Is there a (simple) way to tell from the JavaAPI, say before you actually try to send an email, if the SMTP server is alive (that is, will respond to requests)?
// pseudo code... // if connection.isAlive() // mail.send();
You could open a socket to port 25 on the SMTP host and see if that's successful. Maybe even engage in a little SMTP protocol exchange and make sure it is an SMTP server that's listening.