C# Class Elmah.ErrorMailModule

HTTP module that sends an e-mail whenever an unhandled exception occurs in an ASP.NET web application.
Inheritance: HttpModuleBase, IExceptionFiltering
Afficher le fichier Open project: elmah/Elmah Class Usage Examples

Méthodes protégées

Méthode Description
CreateErrorFormatter ( ) : ErrorTextFormatter

Creates the ErrorTextFormatter implementation to be used to format the body of the e-mail.

GetConfig ( ) : object

Gets the configuration object used by OnInit to read the settings for module.

OnDisposingMail ( ErrorMailEventArgs args ) : void

Fires the DisposingMail event.

OnError ( Exception e, System.Web.HttpContextBase context ) : void

Reports the exception.

OnError ( object sender, EventArgs e ) : void

The handler called when an unhandled exception bubbles up to the module.

OnErrorSignaled ( object sender, ErrorSignalEventArgs args ) : void

The handler called when an exception is explicitly signaled.

OnFiltering ( ExceptionFilterEventArgs args ) : void

Raises the Filtering event.

OnInit ( System.Web.HttpApplication application ) : void

Initializes the module and prepares it to handle requests.

OnMailed ( ErrorMailEventArgs args ) : void

Fires the Mailed event.

OnMailing ( ErrorMailEventArgs args ) : void

Fires the Mailing event.

ReportError ( Error error ) : void

Schedules the error to be e-mailed synchronously.

ReportErrorAsync ( Error error ) : void

Schedules the error to be e-mailed asynchronously.

The default implementation uses the ThreadPool to queue the reporting.

SendMail ( MailMessage mail ) : void

Sends the e-mail using SmtpMail or SmtpClient.

Private Methods

Méthode Description
CreateHtmlAttachment ( string name, string html ) : System.Net.Mail.Attachment
GetSetting ( System.Collections.IDictionary config, string name ) : string
GetSetting ( System.Collections.IDictionary config, string name, string defaultValue ) : string
ReportError ( object state ) : void

Method Details

CreateErrorFormatter() protected méthode

Creates the ErrorTextFormatter implementation to be used to format the body of the e-mail.
protected CreateErrorFormatter ( ) : ErrorTextFormatter
Résultat ErrorTextFormatter

GetConfig() protected méthode

Gets the configuration object used by OnInit to read the settings for module.
protected GetConfig ( ) : object
Résultat object

OnDisposingMail() protected méthode

Fires the DisposingMail event.
protected OnDisposingMail ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Résultat void

OnError() protected méthode

Reports the exception.
protected OnError ( Exception e, System.Web.HttpContextBase context ) : void
e System.Exception
context System.Web.HttpContextBase
Résultat void

OnError() protected méthode

The handler called when an unhandled exception bubbles up to the module.
protected OnError ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Résultat void

OnErrorSignaled() protected méthode

The handler called when an exception is explicitly signaled.
protected OnErrorSignaled ( object sender, ErrorSignalEventArgs args ) : void
sender object
args ErrorSignalEventArgs
Résultat void

OnFiltering() protected méthode

Raises the Filtering event.
protected OnFiltering ( ExceptionFilterEventArgs args ) : void
args ExceptionFilterEventArgs
Résultat void

OnInit() protected méthode

Initializes the module and prepares it to handle requests.
protected OnInit ( System.Web.HttpApplication application ) : void
application System.Web.HttpApplication
Résultat void

OnMailed() protected méthode

Fires the Mailed event.
protected OnMailed ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Résultat void

OnMailing() protected méthode

Fires the Mailing event.
protected OnMailing ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Résultat void

ReportError() protected méthode

Schedules the error to be e-mailed synchronously.
protected ReportError ( Error error ) : void
error Error
Résultat void

ReportErrorAsync() protected méthode

Schedules the error to be e-mailed asynchronously.
The default implementation uses the ThreadPool to queue the reporting.
protected ReportErrorAsync ( Error error ) : void
error Error
Résultat void

SendMail() protected méthode

Sends the e-mail using SmtpMail or SmtpClient.
protected SendMail ( MailMessage mail ) : void
mail System.Net.Mail.MailMessage
Résultat void