Using PHPMailer http://phpmailer.worxware.com/index.php?pg=examples how can I test if my SMTP settings are working, without actually sending an email?
Edit: Maybe I should make this more generic, and just ask how I check a SMTP connction using PHP, without sending an email.
If you are using PHPMailer, you can use the Connect() method, before sending, and check for errors if the connection is not correct.
(From PHPMailer SVN)