Take a look at this:
catch (Exception ex)
{
//Response.Write("Message Delivery Fails");
}
What do you think this does?
It swallows any exception that your code might throw which means you can't tell for sure what went wrong. Either write out ex.Message to the browser, or temporarily remove the try/catch block so you can see the real exception.
Using code block like this is the best way to keep yourself in the dark, clueless of the root cause of the problem...
After you find out the error, reintroduce the catch block, but don't catch a generic Exception, but one or more of the specific exceptions that the Send method might throw....
Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of
Beginning ASP.NET 3.5 : in C# and VB,
ASP.NET 2.0 Instant Results and
Dreamweaver MX 2004
Want to be my colleague? Then check out this post.