CreateUserWizard::SendingMail Event

 

Occurs before the user is sent an e-mail confirmation that an account has been created.

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 CreateUserWizard class will send an e-mail message confirming that a new Web site account has been created when the MailDefinition property defines an e-mail message to send.

Because the e-mail message only has automatic replacement fields for the user name and password fields, you can use the SendingMail event to modify the e-mail message before it is sent to the new user.

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

The following code example uses the SendingMail event to modify the e-mail message that is sent to new users. This example requires a text file named MailFile.txt that contains the following text.

Your account was set up on our Web site with the following:

    Username:   <%UserName%>

To reset your password, you must answer the following question:

    Password Question: <%PasswordQuestion%>  
    Password Answer:   <%PasswordAnswer%>  

Thank you for creating an account with our Web site.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: