Change the passwordrecovery message when sending an email in ASP. NET 2.0

Source: Internet
Author: User
In the ASP. NET 2.0 login control (for details, see my Article , Recovery), in which passwordrecovery (restoring the user password control, when the user enters the password to answer the question, after the answer, the user's user name and password are emailed to the user, where we
It can improve the prompt password information)

<Asp: passwordrecovery id = "passwordrecovery1" runat = "server">

<Maildefinition bodyfilename = "mymail.txt"/>

</ASP: passwordrecovery>

In mymail. txt, you can define it as follows,

 

<! ----> <O: P> </O: P>

Your username is:<% Username %>

Your password is:<% Password %>
In addition, you can define more complex in the onsendmail event, as shown below:

 

<Asp: passwordrecovery id = "passwordrecovery1" runat = "server" onsendingmail = "passwordrecovery#sendingmail">

<O: P> </O: P> 

<O: P> </O: P> 

Protected void passwordrecovery1_sendingmail (Object sender, mailmessageeventargs E)

{

// Get the username and password for the user here

E. Message. Body = "The accont information message ....";

}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.