System.Web 2.0.0.0 System.Delegate `` `` System.Void To be added. To be added.

When you create a delegate, you identify the method that will handle the event. To associate the event with the event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate from the event. For more information about event-handler delegates, see Server Event Handling in ASP.NET Web Pages.

Handling the SendMailError event allows your Web application to continue running, even if an exception occurs when trying to send an e-mail message. For example, this is useful if the exception occurs when a user is working through a multi-step wizard. It is preferable to log the error, display an informative message to the user, and allow the user to complete the wizard rather than terminate the application.

If you do not create an event handler for the event, or if you create an event handler but leave the property set to false, your Web application will stop running if an error occurs when sending an e-mail message, and ASP.NET will display an error message.

The method also allows derived classes to handle the event instead of the . This is the preferred technique for handling the event in a class that is derived from or .

For more information about handling events, see Server Event Handling in ASP.NET Web Pages.

Represents the method that handles the SendMailError event of controls such as the control, the control, and the control.