CreateUserWizard.OnSendMailError Method

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

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

protected:
virtual void OnSendMailError (
	SendMailErrorEventArgs^ e
)
protected void OnSendMailError (
	SendMailErrorEventArgs e
)
protected function OnSendMailError (
	e : SendMailErrorEventArgs
)
Not applicable.

Parameters

e

A SendMailErrorEventArgs containing the event data.

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

Examine the Exception property of the 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 Handled property of the SendMailErrorEventArgs object passed as the e parameter to signal that the exception that caused the OnSendMailError 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 OnSendMailError 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.

Notes to Inheritors: When overriding OnSendMailError in a derived class, be sure to call the base class’s OnSendMailError method so that registered delegates receive the event.

The following code example defines a custom CreateUserWizard object that logs e-mail errors to a site-specific logging function.

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

The following code example demonstrates a Web page that uses the CustomCreateUserWizard.

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

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: