Send "Forgot password" reminder via email
I'd like to know how to implement the "Forgot Password" feature on
many websites which require a login, exactly like this ebay example:
I've already retrieved the users password from the database - I just
need to send it to the email address entered.
From reading many posts, I need a server-side script and rather not
Any help/pointers appreciated.
Re: Send "Forgot password" reminder via email
"groupie" <firstname.lastname@example.org> wrote in message
> I'd like to know how to implement the "Forgot Password" feature on
> many websites which require a login, exactly like this ebay example:
> I've already retrieved the users password from the database - I just
> need to send it to the email address entered.
> From reading many posts, I need a server-side script and rather not
> Any help/pointers appreciated.
You are right you would never want any response going back to the client
that contained the password.
The email address should have been registered and verified as part of the
account set up and therefore held in the DB already. The email address that
you send should only be the one verified for the user account. Thus no one
can impersonate a UserID and have the password sent to a different email
Having pulled the email address and password from the DB you can use the
following to send an email:-
Sub SendPassword(rsEmail, rsPassword)
Dim oMsg : Set oMsg = Server.CreateObject("CDO.Message")
oMsg.To = rsEmail
oMsg.Subject = "Your password"
oMsg.HTMLBody = "<html><body>" & rsPassword & "</body></html>"
Set oMsg.Configuration = GetConfig() 'delete if server already configured
Set GetConfig = Server.CreateObject("CDO.Configuration")
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Note that in GetConfig you need to replace "yourserver" with an SMTP server
name that your Web server can use to send email. Alternative your site may
be configured via IIS manager with these values, in which case you can
delete the GetConfig stuff altogether.
Anthony Jones - MVP ASP/ASP.NET
|All times are GMT. The time now is 05:44 PM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.