Export (0) Print
Expand All

CreateUserWizard::SendMailError Event

Occurs when there is an SMTP error sending e-mail to the new user.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
 event SendMailErrorEventHandler^ SendMailError {
	void add (SendMailErrorEventHandler^ value);
	void remove (SendMailErrorEventHandler^ value);
}
<asp:CreateUserWizard OnSendMailError="SendMailErrorEventHandler" />

The SendMailError event is raised when there is a problem using the SMTP mail provider to send e-mail to the e-mail address provided by the new user. The most common reason to raise this event is when the <smtpMail> section of the Web.config file is incorrect.

The default SendMailError event handler does not catch or handle the SMTP error from the e-mail system. Your SendMailError event handler must set the Handled property of the SendMailErrorEventArgs object to true in order to stop the error from appearing to the Web site user.

For more information about handling events, see Consuming Events.

The following code example is a handler for the SendMailError event that calls a site-specific procedure to log the e-mail error. The Handled property of the SendMailErrorEventArgs object is set to true to indicate that the error has been handled.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft