Re: How to find out what type of error it is: Failure sending mail.
- From: "JoeP" <NoSpam@xxxxxxxxxxx>
- Date: Mon, 24 Dec 2007 20:07:08 -0500
Well I had actuallt the code like the below: The debugger poped up and just said that the Failure sending mail.
and did not provide the reason. But from some reason in my computer under Visual Studio 2005, the Alert message did not pop up.
Just wondering why? (The debugger did).
Thanks,
Joe
Try
some code.....
oMailMessage.IsBodyHtml = False
oMailMessage.Body = cEmailBody
Dim oSMTP As New SmtpClient
oSMTP.Send(oMailMessage) (in this line I am getting the above err)
Catch smtpEx As SmtpException
ClientScript.RegisterStartupScript(Me.GetType(), "E-Mail Problem", String.Format("Alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "\'")), True)
Catch generalEx As Exception
ClientScript.RegisterStartupScript(Me.GetType(), "General Problem", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "\'")), True)
End Try
"Scott M." <smar@xxxxxxxxxxxxx> wrote in message news:%23lIk0%23cRIHA.4444@xxxxxxxxxxxxxxxxxxxxxxx
Wrap the code in a try...catch block?
"JoeP" <NoSpam@xxxxxxxxxxx> wrote in message news:%23i4RTOcRIHA.3516@xxxxxxxxxxxxxxxxxxxxxxx
Hi All,
How can I find the reason for such an error: Failure sending mail.
Some Code...
oMailMessage.IsBodyHtml = False
oMailMessage.Body = cEmailBody
Dim oSMTP As New SmtpClient
oSMTP.Send(oMailMessage) (in this line I am getting the above err)
Appreciate any feedback
Thanks,
Joe
- Follow-Ups:
- References:
- Prev by Date: Re: What is the easiest way to find a control in a parent?
- Next by Date: Re: How to find out what type of error it is: Failure sending mail.
- Previous by thread: Re: How to find out what type of error it is: Failure sending mail.
- Next by thread: Re: How to find out what type of error it is: Failure sending mail.
- Index(es):
Relevant Pages
|