03.11.2016 Views

Beginning ASP.NET 4.5 in CSharp and VB Opsylum

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

620 x CHAPTER 16 SECURITY IN YOUR <strong>ASP</strong>.<strong>NET</strong> <strong>4.5</strong> WEBSITE<br />

5. Save all changes <strong>and</strong> request SignUp.aspx <strong>in</strong> your browser. Enter the required details for a new<br />

account <strong>and</strong> click Create User to sign up for an account. If you get an error about specify<strong>in</strong>g a<br />

From address, make sure you assigned a valid e-mail address to the from attribute <strong>in</strong> the Web.config<br />

file:<br />

<br />

Refer to Chapter 9 to see how to add this attribute. Make sure you enter a valid e-mail address or<br />

the mail server may still reject it.<br />

6. After a while, you should receive an e-mail that conta<strong>in</strong>s the welcome text you typed <strong>in</strong> step 2.<br />

Figure 16-12 shows the message with the UserName <strong>and</strong> Password placeholders replaced with the<br />

details that you entered <strong>in</strong> step 5.<br />

FIGURE 16-12<br />

How It Works<br />

The CreateUserWizard comes with built-<strong>in</strong> functionality to send a confirmation message to the user. It<br />

doesn’t send the message until you specify the element. You use the BodyFileName<br />

property to po<strong>in</strong>t to a text file or an HTML file that is used as the e-mail’s body.<br />

With<strong>in</strong> this body, you can use the special placeholders <strong>and</strong> ,<br />

which are replaced automatically with the actual username <strong>and</strong> password that the user entered <strong>in</strong> the<br />

signup form.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!