Hi,
I cannot figure out why the Application_Error event is not firing. I simply want to send an email whenever an error occurs. I don't receive any errors. it just does not fire. The C# code is below:
protected void Application_Error(Object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
string ErrorMessage = "The error description is as follows : " + Server.GetLastError().ToString();
mail.To = "user@email.com";
mail.Subject = "Error in the Site";
mail.Priority = MailPriority.High;
mail.BodyFormat = MailFormat.Text;
mail.Body = ErrorMessage;
SmtpMail.SmtpServer = "server1";
SmtpMail.Send(mail);
}
any thoughts on what I am missing??
Thanks,
DMill
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================
I cannot figure out why the Application_Error event is not firing. I simply want to send an email whenever an error occurs. I don't receive any errors. it just does not fire. The C# code is below:
protected void Application_Error(Object sender, EventArgs e)
{
MailMessage mail = new MailMessage();
string ErrorMessage = "The error description is as follows : " + Server.GetLastError().ToString();
mail.To = "user@email.com";
mail.Subject = "Error in the Site";
mail.Priority = MailPriority.High;
mail.BodyFormat = MailFormat.Text;
mail.Body = ErrorMessage;
SmtpMail.SmtpServer = "server1";
SmtpMail.Send(mail);
}
any thoughts on what I am missing??
Thanks,
DMill
======================================
"I wish that I may never think the smiles of the great and powerful a sufficient inducement to turn aside from the straight path of honesty and the convictions of my own mind."
-David Ricardo, classical economist
======================================