By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,686 Members | 1,558 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,686 IT Pros & Developers. It's quick & easy.

Emailing Errors from Pages

P: n/a
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub
Nov 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #2

P: n/a
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #3

P: n/a
please make sure you have the cdo dll installed on the server. if it is, you
will need to re-register it at the command line using the regsvr32 utility

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
>I am trying to get my "Global.asax" error handling event to email me
> an error description. I believe I have the SMTP code correct and
> pointing it to my company's Exchange Server. I still fail to get my
> "localhost" installation of my app to send emails. I have checked in
> MMC to see that the Default SMTP server is running on my box. I have
> not entered any configs into that.
>
> Any tips?
>
> Brian
>
> Here is what I have coded in Global.asax :
> Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
> ' Fires when an error occurs
> ' Brian
> ' 04/14/2004
> Try
> Mail.SmtpMail.SmtpServer = "our.exchange.server"
> Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
> mlMessage.Body =
> HttpContext.Current.Server.GetLastError().ToString ()
> mlMessage.To = "on****@advancetechnology.com"
> mlMessage.From = "WebUser"
> mlMessage.Subject = "Error"
> Call Mail.SmtpMail.Send(mlMessage)
>
> Catch ERR As System.Exception
> ' Just ignore it at this point.
> End Try
> End Sub

Nov 18 '05 #4

P: n/a
Check the InnerException and InnerException's InnerException property. They
can be nested two or three deep. The innermost exception has the actual
error message that caused the problem.

Eric
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
Error occurs at line :
Call Mail.SmtpMail.Send(mlMessage)

And is phrased :
System.Web.HttpException: Could not access 'CDO.Message' object.

"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message

news:<Od*************@TK2MSFTNGP11.phx.gbl>...
what is the error

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Brian" <bo***@vafb.com> wrote in message
news:d2**************************@posting.google.c om...
I am trying to get my "Global.asax" error handling event to email me
an error description. I believe I have the SMTP code correct and
pointing it to my company's Exchange Server. I still fail to get my
"localhost" installation of my app to send emails. I have checked in
MMC to see that the Default SMTP server is running on my box. I have
not entered any configs into that.

Any tips?

Brian

Here is what I have coded in Global.asax :
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Fires when an error occurs
' Brian
' 04/14/2004
Try
Mail.SmtpMail.SmtpServer = "our.exchange.server"
Dim mlMessage As Mail.MailMessage = New Mail.MailMessage
mlMessage.Body =
HttpContext.Current.Server.GetLastError().ToString ()
mlMessage.To = "on****@advancetechnology.com"
mlMessage.From = "WebUser"
mlMessage.Subject = "Error"
Call Mail.SmtpMail.Send(mlMessage)

Catch ERR As System.Exception
' Just ignore it at this point.
End Try
End Sub

Nov 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.