Monday, March 26, 2012

smtp mail problem

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?Use error trapping:

C#:

try
{
// Send the mail here.
}
catch
{
// Catch the error if there is one.
}

0 comments:

Post a Comment