handling Application_Error in ASP.NET app's global.asax
<p>I wish to send mail to an administrator when the application crashes.
So I simply do this in <code>global.asax</code>:</p>

<pre><code>void Application_error(object sender, EventArgs e)
{
    SendMessageToAdministarator(Server.GetLastError().ToString());
}
</code></pre>

<p>But actually many times <code>Application_Error</code> is called even though the application won't crash.</p>

<p>And I wish to send mail to admin ONLY when the application crashed.</p>

<p>Also, do I have a simple way to lift the application back on?</p>

<p>I'm looking for the simplest solution.</p>
