Raises the CreateUserWizard.SendingMail event before an e-mail message is sent to a new user.
- e
- A System.Web.UI.WebControls.MailMessageEventArgs containing the event data.
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.