B
Brian
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 = "(e-mail address removed)"
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
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 = "(e-mail address removed)"
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