creating "forgot password" page

Results 1 to 2 of 2

Thread: creating "forgot password" page

  1. #1
    Join Date
    Dec 1969

    Default creating "forgot password" page

    I want to make a simple "forgot password" page that, given a registered e-mail address, e-mails the password to the user. Can anyone point me to a tutorial? Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: creating

    No, but I&#039;ll give you the steps:<BR><BR>1) Take the email address, store it in a string (sEmail) and create a query to your DB.<BR><BR>e.g. "Select UserPassword From Users Where UserEmail = &#039;" & sEmail & "&#039;;"<BR><BR>2) Open a datareader and grab the value.<BR><BR>3) Add these to the top of your page. <BR><BR>Imports System.Web<BR>Imports System.Web.Mail<BR><BR>Then:<BR><BR>Dim _mm As New MailMessage<BR>SmtpMail.SmtpServer = ""<BR>_mm.BodyFormat = Mail.MailFormat.Html<BR>_mm.From = ""<BR>_mm.Subject = "Here is your password!"<BR>_mm.To = sEmail<BR>_mm.Body = "the contents of your email (include the password from you grabbed using the datareader)"<BR> SmtpMail.Send(_mm)<BR><BR>That will do it. However, I personally wouldn&#039;t recommend emailing the user their password - not a good method, but that&#039;s your choice. You&#039;d be better storing a secret question/answer pair and allowing them to set a new password.<BR><BR>Google for MD5, or have a look a System.Security.Cryptography as you should really encrypt stored passwords.<BR><BR>Just some hints and tips, but in the end its down to you.<BR><BR>Happy coding ;D<BR><BR>James.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts