System.Web.UI.WebControls.ChangePassword.OnSendingMail Method

Raises the ChangePassword.SendingMail event before an e-mail message is sent to the SMTP server for processing. The SMTP server then sends the e-mail message to the user.

Syntax

protected virtual void OnSendingMail (MailMessageEventArgs e)

Parameters

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

Remarks

Use the ChangePassword.OnSendingMail(MailMessageEventArgs) method to modify the e-mail message that is sent to users after they change their password. The MailMessageEventArgs.Message property of the System.Web.UI.WebControls.MailMessageEventArgs object will be sent to the SMTP server for processing. Modify the properties of the System.Web.Mail.MailMessage object to modify the e-mail message.

E-mail messages are created only when the MailDefinition.BodyFileName property of the System.Web.UI.WebControls.MailDefinition object specified by the ChangePassword.MailDefinition property points to a valid file name.

Note:

Sending user account names or passwords in e-mail is a potential security threat. E-mail messages are typically sent in plain text and can be read by special network "sniffing" applications. To improve security, use the mitigations that are described in Securing Login Controls.

Raising an event invokes the event handler through a delegate. For more information, see Server Event Handling in ASP.NET Web Pages.

The ChangePassword.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