views:

239

answers:

1

I want to customize asp:PasswordRecovery control. I am using asp.net membership to control login etc.

How do I change "from" email-address on the email that sends the new password?

How do I change the content of the email that sends the new password?

+1  A: 

yes you can use Maildefinition tag

<MailDefinition   
 From="[email protected]"
 Subject="your subject"
 BodyFileName="~/_txt/Recovery.txt" ></MailDefinition>

Create a recovery.txt file like this :

The password for your user account was retrieved successfully. Follows your credentials for logging-in: UserName: <% UserName %> Password: <% Password %>

and add this in your webconfig file after configSections tag

<system.net>
<mailSettings>
  <smtp>
    <network host="[email protected]" 
                 port="25" 
                 userName="your username" 
                 password="your password"/>
  </smtp>
</mailSettings></system.net>

Gianluca Maggio Cavallaro

gianluca