System.Web.UI.WebControls.CreateUserWizard.OnSendMailError Method

Raises the CreateUserWizard.SendMailError event when e-mail cannot be sent to the new user.

Syntax

protected virtual void OnSendMailError (SendMailErrorEventArgs e)

Parameters

e
A System.Web.UI.WebControls.SendMailErrorEventArgs containing the event data.

Remarks

The CreateUserWizard.OnSendMailError(SendMailErrorEventArgs) method is called when the SMTP mail system raises an exception while attempting to send e-mail to the new user.

Examine the SendMailErrorEventArgs.Exception property of the System.Web.UI.WebControls.SendMailErrorEventArgs object passed as the e parameter to determine the actual cause of the exception. The most common problem is a configuration error in the <smtpMail> section of the Web.config file.

You must set the SendMailErrorEventArgs.Handled property of the System.Web.UI.WebControls.SendMailErrorEventArgs object passed as the e parameter to signal that the exception that caused the CreateUserWizard.OnSendMailError(SendMailErrorEventArgs) method to be called has been taken care of, otherwise the exception is re-thrown.

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The CreateUserWizard.OnSendMailError(SendMailErrorEventArgs) method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Requirements

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