I don't have a problem sending mail, but it's just that if the mail server is down you get an Error page as a connection to the server was not available.

How can i catch this and redirect to an error page of my own, to stop the application halting?