Sekhar
Sekhar

Reputation: 5787

send the new password - Asp.net - using gmail ( smtp.gmail.com )

I've gone through all helps and all forums., but none of them have helped me. Here is my problem

  1. Developing a site on localhost using ASP.NET 3.5
  2. I want to provide 'forgot password' functionality using <asp:PasswordRecovery>
  3. Any real help is greatly appreciated. Please note that I want to send it by either changing web.config OR programatically.

Thanks

Upvotes: 0

Views: 1759

Answers (2)

Flatlineato
Flatlineato

Reputation: 1066

You can set smtp via web config:

<system.net>
        <mailSettings>
            <smtp deliveryMethod="Network" from="[email protected]">
                <network defaultCredentials="true" host="localhost" port="25" userName="kaushal" password="testPassword"/>
            </smtp>
        </mailSettings>
    </system.net>

Upvotes: 0

Mark Byers
Mark Byers

Reputation: 838186

There is an article on MSDN explaining how to use the PasswordRecovery control.

There is also a thread specifically regarding using GMail with the control.

I believe that the best way is to use the SendingMail event method and send your own email, thus setting the MailMessage object and the SmtpClient object within the method. Then, set the Cancel property to true, so that the other email won't be sent.

I have not tried it myself though. If you want more specific help, show what you have tried and why it doesn't work.

Upvotes: 2

Related Questions