System.Web.UI.WebControls.SendMailErrorEventArgs.Handled Property

Indicates if the SMTP exception that is contained in the SendMailErrorEventArgs.Exception property has been handled.

Syntax

public bool Handled { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The SendMailErrorEventArgs.Handled property indicates if the SendMailErrorEventArgs.Exception has been handled. The exception is raised by the SMTP mail provider when an e-mail message cannot be sent by the System.Web.UI.WebControls.ChangePassword control or the System.Web.UI.WebControls.CreateUserWizard. The most common reason for the exception is a configuration error in the smtp Element (Network Settings) of the machine configuration file. Although an error like this is typically discovered during the development and debugging of an application, mail servers can fail unexpectedly in a production environment, and you must determine whether you want the entire application to fail in that situation. If not, handling the event allows your application to proceed.

If you do not create an event handler for the ChangePassword.SendMailError event, or if you create an event handler but leave the SendMailErrorEventArgs.Handled 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. Handling the event allows your Web application to continue to run even though an exception has occurred. This is useful when it is not critical to send an e-mail message. For example, if the exception occurs when a user is working through a multi-step wizard, it can be advantageous to log the error, display an informative message to the user, and allow the user to complete the wizard.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0