Search code examples
asp.netforgot-password

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


Solution

  • 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.