Click to See Complete Forum and Search --> : Forgotten passwords sent via email


carmen2u
05-07-2003, 10:16 AM
Ideally, I want to be able to send our web visitors their
passwords in cases where they've forgotten them. I have
created a form allowing a visitor to enter his email
address which I wish to check against our database of
emails to validate. Upon validation, I wish to send his
password from the database via email transmission. I
cannot use CDONTS since our mailer server is non-IIS, but
that's okay since CDO works fine.

Though I have been able to get a password/username
authentication ASP page working (using an Access database
via ADODB.Connection which runs a SQL statement to verify
password and username), and have also been able to build
a different form that allows for email (using CDOSYS
constants), I cannot for the life of me combine elements
of both to produce this forgot email/send password ASP
page. Help!

When I attempt to incorporate code of one into the other
and post this new invention, it fails even to appear on
the web. I think the problem lies with the email authentication
code. Before I figured out that CDONT doesn't work on non-
IIS mail servers, I got the following error: "Microsoft
VBScript runtime error '800a0046' Permission denied",
while attempting CDONT and DATA_PATH code.
Consequently, I tried using my successful
password/username ASP code that employed the
ADODB.Connection with a SQL statement--this I tried to
combine with the independently working formmail code, but
it wouldn't even appear as a webpage though I posted it!

As for the code for the form/email, it is from Sorted
Sites http://www.sortedsites.com. It is easy to modify
and use, and it works when used on its own. But no matter
how I adapt it, I cannot get code that incorporates my
database email validation/password selection to work
simultaneously. Any thoughts? There's no urgency, just a
thorny problem I wish to resolve so I can incorporate
this feature on our company web site. Thanks to all you
can lend a hand.

Bullschmidt
05-07-2003, 03:26 PM
' Set sql.
strSQL = "SELECT UserID, UserPassword, UserEmail "
strSQL = strSQL & "FROM tblUser "
strSQL = strSQL & "WHERE (UserID=" & Chr(39) & Request.Form("UserID") & Chr(39) & ")"

' Open rs.
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open strSQL, objConn

' If not empty rs.
If Not objRS.EOF Then

' Move to 1st rec.
objRS.MoveFirst

strUserID = UserID
strUserPassword = objRS("UserPassword")
strUserEmail = objRS("UserEmail")

[Then send an e-mail to strUserEmail including the information about strUserID and strUserEmail.]

End If

' Close rs.
objRS.Close
Set objRS = Nothing

carmen2u
05-07-2003, 05:01 PM
Thanks for your suggestion. I ended up doing something a tad different and finally have this albatross off my neck. I appreciate all your help.