Sending a Create User Email Message

You can set up the CreateUserWizard control so that it automatically sends an email when a new user registers. For example, you can send an email that contains the new user’s registered username and password to that user’s email account.

Warning

Sending an unencrypted email across the Internet with a user’s password is dangerous. However, it also is a common practice to include a password in a registration confirmation email.

The page in Listing 26.15 includes a MailDefinition property that specifies the properties of the email that is sent to a user after the user successfully registers.

Listing 26.15. CreateUserWizardEmail.aspx

The MailDefinition class supports the following properties:

BodyFileName ...

Get ASP.NET 4 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.