Google Answers Logo
View Question
 
Q: Retrieve lost password in ASP ( No Answer,   1 Comment )
Question  
Subject: Retrieve lost password in ASP
Category: Computers > Internet
Asked by: elfynet-ga
List Price: $10.00
Posted: 19 Jun 2003 01:33 PDT
Expires: 20 Jun 2003 07:59 PDT
Question ID: 219126
I want to have a page on my website where a registered user can
retrieve his lost password upon submission of his email address. The
password is then sent to his email address.
The data structure in the database is as follows (in Access)

tblForumParticipants

Username
Password
Email

My website is in ASP VBscript, hosted on a Microsoft Server that
supports the JMail and ASPMail components.
I have a simple submission form that retrieves the email address in
the “Email” field.
What code should I use in the page processing the form?
(I found tutorials using the CDONTS component but it is not supported
by my ISP)
Answer  
There is no answer at this time.

Comments  
Subject: Re: Retrieve lost password in ASP
From: nathanrice-ga on 19 Jun 2003 11:32 PDT
 
‘Create a database connection and retrieve the users password from the
submitted email address
set oConn=Server.CreateObject("ADODB.connection")
vCS = "Provider=Microsoft.Jet.OLEDB.4.0; 
Data Source=”c:\inetpub\wwwroot\database\accesssample.mdb" ‘Change
this to point to your db connection

oConn.connectionstring = vCS
oConn.Open
set oRS=server.createobject("ADODB.recordset")
strCommand = "SELECT Password FROM tblForumParticipants WHERE
Username=’" & Request.Form(“EmailAddress”) & “’”


Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName   = "Joe’s Widgets Corp."
Mailer.FromAddress= "Joe@somehost.com"
Mailer.RemoteHost = "mailhost.localisp.net"
Mailer.AddRecipient "John Smith", "jsmith@anotherhostname.com"
Mailer.Subject    = "Your Widgets Corp. password."
Mailer.BodyText   = "Dear Stephen" & VbCrLf & "Your widgets password
is " & oRS(“Password”).Value
if Mailer.SendMail then
  Response.Write "Mail sent..."
else
  Response.Write "Mail send failure. Error was " & Mailer.Response
end if


------
That should work but I haven't tried or debuged it, I'm pretty sure I
probably fat fingered something so you'll have to double check it.
It's a start though.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy