Hello! :D try { SmtpMail.SmtpServer="mysmtpserverdude.com; SmtpMail.Send("me@mysmtpserverdude.com,"myself@ejii.com","hi","hello"); }catch(System.HttpException wrong) { Response.Write(wrong.Message) }
well... looks good :D, but it aint do me no good :) if i put in a wrong emailadress and try to send it, the errormessage "Cant access CDO Message" will be displayed. But that is NOT the true error message. if i DONT use Try Catch and using Debug mode
in VS. I get an error page saying System.Runtime.InteropServices.COMException "The mail receipents was rejected", THAT is the correct error message i want to catch. How do i do that?. I tried using the System.Runtime.InteropServices.COMException like this:
}catch(System.Runtime.InteropServices.COMException wrong) { Response.Write(wrong.Message) } But it did me no good at all, it couldnt catch it at all :( .. soo.. i want to know how to catch the TRUE error :D
None
0 Points
278 Posts
catching the TRUE System.Web.Mail.Exception :)
Mar 24, 2005 03:46 PM|badbanana|LINK
try { SmtpMail.SmtpServer="mysmtpserverdude.com; SmtpMail.Send("me@mysmtpserverdude.com,"myself@ejii.com","hi","hello"); }catch(System.HttpException wrong) { Response.Write(wrong.Message) }
well... looks good :D, but it aint do me no good :) if i put in a wrong emailadress and try to send it, the errormessage "Cant access CDO Message" will be displayed. But that is NOT the true error message. if i DONT use Try Catch and using Debug mode in VS. I get an error page saying System.Runtime.InteropServices.COMException "The mail receipents was rejected", THAT is the correct error message i want to catch. How do i do that?. I tried using the System.Runtime.InteropServices.COMException like this: }catch(System.Runtime.InteropServices.COMException wrong) { Response.Write(wrong.Message) } But it did me no good at all, it couldnt catch it at all :( .. soo.. i want to know how to catch the TRUE error :DMember
30 Points
120 Posts
Re: catching the TRUE System.Web.Mail.Exception :)
Mar 27, 2005 04:45 PM|rbuckton|LINK
A peek through reflector shows this:
The HttpException is thrown with additional information over and above the COMException that is thrown by the actual call to CDO.
If you want to read the COMException, try inspecting the InnerException property of the HttpException that was raised:
Senior Consultant
Microsoft
None
0 Points
60 Posts
Re: catching the TRUE System.Web.Mail.Exception :)
Mar 30, 2005 03:52 AM|Breakfast|LINK
That should get you the right exception eventually.