System.Web.UI.WebControls.CreateUserWizard.OnSendingMail Method

Raises the CreateUserWizard.SendingMail event before an e-mail message is sent to a new user.

Syntax

protected virtual void OnSendingMail (MailMessageEventArgs e)

Parameters

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

Remarks

Use the CreateUserWizard.OnSendingMail(MailMessageEventArgs) method to modify the e-mail message sent to new users. The MailMessageEventArgs.Message property of the System.Web.UI.WebControls.MailMessageEventArgs object passed as the e parameter contains the System.Web.Mail.MailMessage object that will be sent to the new user. Modify the properties of the System.Web.Mail.MailMessage object to modify the e-mail message.

E-mail messages are only created when the MailDefinition.BodyFileName property of the CreateUserWizard.MailDefinition object specified by the CreateUserWizard.MailDefinition property points to a valid file name.

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

The CreateUserWizard.OnSendingMail(MailMessageEventArgs) 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