C# Класс Elmah.ErrorMailModule

HTTP module that sends an e-mail whenever an unhandled exception occurs in an ASP.NET web application.
Наследование: HttpModuleBase, IExceptionFiltering
Показать файл Открыть проект Примеры использования класса

Защищенные методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

CreateErrorFormatter() защищенный Метод

Creates the ErrorTextFormatter implementation to be used to format the body of the e-mail.
protected CreateErrorFormatter ( ) : ErrorTextFormatter
Результат ErrorTextFormatter

GetConfig() защищенный Метод

Gets the configuration object used by OnInit to read the settings for module.
protected GetConfig ( ) : object
Результат object

OnDisposingMail() защищенный Метод

Fires the DisposingMail event.
protected OnDisposingMail ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Результат void

OnError() защищенный Метод

Reports the exception.
protected OnError ( Exception e, System.Web.HttpContextBase context ) : void
e System.Exception
context System.Web.HttpContextBase
Результат void

OnError() защищенный Метод

The handler called when an unhandled exception bubbles up to the module.
protected OnError ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
Результат void

OnErrorSignaled() защищенный Метод

The handler called when an exception is explicitly signaled.
protected OnErrorSignaled ( object sender, ErrorSignalEventArgs args ) : void
sender object
args ErrorSignalEventArgs
Результат void

OnFiltering() защищенный Метод

Raises the Filtering event.
protected OnFiltering ( ExceptionFilterEventArgs args ) : void
args ExceptionFilterEventArgs
Результат void

OnInit() защищенный Метод

Initializes the module and prepares it to handle requests.
protected OnInit ( System.Web.HttpApplication application ) : void
application System.Web.HttpApplication
Результат void

OnMailed() защищенный Метод

Fires the Mailed event.
protected OnMailed ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Результат void

OnMailing() защищенный Метод

Fires the Mailing event.
protected OnMailing ( ErrorMailEventArgs args ) : void
args ErrorMailEventArgs
Результат void

ReportError() защищенный Метод

Schedules the error to be e-mailed synchronously.
protected ReportError ( Error error ) : void
error Error
Результат void

ReportErrorAsync() защищенный Метод

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
Результат void

SendMail() защищенный Метод

Sends the e-mail using SmtpMail or SmtpClient.
protected SendMail ( MailMessage mail ) : void
mail System.Net.Mail.MailMessage
Результат void