Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PasswordRecovery::SendingMail Event

 

Occurs before the user is sent a password in e-mail.

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

public:
event MailMessageEventHandler^ SendingMail {
	void add(MailMessageEventHandler^ value);
	void remove(MailMessageEventHandler^ value);
}

The SendingMail event occurs on the server after the user requests a new or recovered password and submits a correct answer to the password confirmation question (if your membership provider supports password question and answer), but before the password is sent to the user in e-mail. Use this event to do any special processing required before sending the e-mail message, such as setting MailMessage properties.

After the user enters a valid user name and, if relevant, a valid answer, the PasswordRecovery control raises the SendingMail event, and then sends the password information to the user in e-mail. The e-mail uses the settings defined in the <smtpMail> configuration file element.

For more information about handling events, see NIB: Consuming Events.

The following code example uses the SendingMail event to set properties of the MailMessage object that contains the e-mail message.

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

.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft