<asp:PasswordRecovery ID="PasswordRecovery1" runat="server">
<MailDefinition BodyFileName="myMail.txt"/>
</asp:PasswordRecovery>
其中,在MYMAIL.TXT中,可以这样定义,
<!----><o:p> </o:p>
你的用户名是: <% UserName %>
你的密码是: <% Password %>
此外,还可以在onsendmail事件中定义更复杂的,如下
<asp:PasswordRecovery ID="PasswordRecovery1" runat="server" OnSendingMail="PasswordRecovery1_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 ....";
}