Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 108715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:57:20+00:00 2026-05-11T01:57:20+00:00

I wish to send mail to an administrator when the application crashes. So I

  • 0

I wish to send mail to an administrator when the application crashes. So I simply do this in global.asax:

void Application_error(object sender, EventArgs e) {     SendMessageToAdministarator(Server.GetLastError().ToString()); } 

But actually many times Application_Error is called even though the application won’t crash.

And I wish to send mail to admin ONLY when the application crashed.

Also, do I have a simple way to lift the application back on?

I’m looking for the simplest solution.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:57:20+00:00Added an answer on May 11, 2026 at 1:57 am

    What kind of errors are send when the application is not crashed? You could check the type of exception and don’t send emails on the exceptions that don’t crash the app (for example a redirect can throw the ThreadAbortException which I manually filter in code):

    protected void Application_Error(Object sender, EventArgs e) {     Exception ex = Server.GetLastError();     if (ex is ThreadAbortException)         return;     Logger.Error(LoggerType.Global, ex, 'Exception');     Response.Redirect('unexpectederror.htm'); } 

    You could add a redirect to an error page with a message for the user that an error has occured and some links to relevant pages in the site. This is for the ‘lift the application back on’ – I hope this is what you wanted.

    Also you might look into logging with log4net which can also log errors on the server and send emails on errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to send an email from my localhost machine (using PHPs mail function)
My current application send an .rtf in an attachement. I wish to send pdf
I wish to send text between processes. I have found lots of examples of
I wish to code a little service where I will be able to send
In this scenario I wish too bypass my normal error logging, which wont work,
In the microblogging application I am developing I wish to show an user image
I'm using PEAR's Mail package to send email from my script. I'm pretty sure
I wish to send an email, with a plain text and html version. The
I have a method send() that I wish to execute/call every 1 second. I'm
I wish to upload from my Flash Application (AS3) to imageshacks XML API. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.