Send user Password by Email if User forgets

Allow the your Users the opportunity to receive their Passwords by Email if they forget by submitting their Usernames. Once the User submits his or her registered Username, an email is automatically sent to the Email the Username registered with.
 
 
Part 1 » Part 2 » Part 3 -- Demo
 
Forgotten Password- Part 3-
Automatically Send Users their Passwords via Email upon request if it has been forgotten

Note: I have a question for you. Where is our Jmail code? Right, it is in our forgotpassword1.asp page. Why not play around with the email message in the code to adjust it a bit for this situation. I made some changes to the body text of the email. My Jmail for this page is as such: (notice bolds)
<%
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ServerAddress = "mail.yourwebsite.com:25"
JMail.ContentType = "text/html"
JMail.Sender = "x@yourwebsite.com"
JMail.SenderName = "UDnewbie"
JMail.Subject = "Account Password"
JMail.AddRecipient strRecipient
JMail.Body = "<font face='verdana' size ='3'>" &_
"Ahlan!" & strFirstName & " " & strLastName &_
"<br><br>" &_
"This Email Notification comes to you from Udnewbie.com. " &_
"<br>" &_
"Here is the information you requested:" &_
"<p>" &_
"Username:" & strUserName &_
"<br>" &_
"Password:" & strPassword &_
"<p>" &_
"Visit <a href='http://www.UDnewbie.com'>http://www.UDnewbie.com</a>
for more UltraDev tutorials" &_
"<p>" &_
"Regards," &_
"<br>" &_
"Omar Elbaga" &_
"<br>" &_
"UDnewbie.com" &_
"</font>"

JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
JMail.Execute
%>



Step 5:

- We just want to make that page that the person is redirected to if the UserName isn't registered.

- Make a new page and type something like:
Sorry but the User Name you entered was either spelled incorrectly or has never been registered.
Put whatever message you want informing the person of the error. It would be nice of you to put a link on this page to go back to the previous page and the register page.
- Save this page As forgotpasswordfailed.asp and upload it. Name it whatever you like just make sure you redirected appropriately to the name of your page when you were working on the forgotpassword1.asp page.

That's it! Now our users can get their password sent to them automatically if they ever forget it.
Go eat something and drink lots of water. i know you've been working hard. You might need some gatorade!
 
Back to Top

Omar Elbaga

Starting out as a fine artist, Omar Elbaga gradually moved to computer graphic arts. He was particularly amazed by the power of the World Wide Web, so he embarked upon building small-scale sites for fun utilizing HTML and his Art background. Falling in love with designing web pages and its potential, he began a career in web design. Omar has since been in the web development field for several years. With his head in computer books nearly 24 hours a day, Omar moved on to enhance his skills from web design to web programming.

Most of his work involves building database-driven web sites for small companies. Omar is currently running a popular Dreamweaver MX resource site named dmxfire.com

See All Postings From Omar Elbaga >>

Comments

Page layout of Tutorial

January 24, 2002 by ahha haha

Hi all,

i like to print out these tutorials as I find it helps me do things step by step, but while printing out these pages things are not formated correctly, ie text on the right ends up overlapping some of the tutorial, and sometimes the page is cut between important lines. can something be done about this .

Super regards

 

ah ha

RE: Page layout of Tutorial

January 24, 2002 by Omar Elbaga

Hi,
is that only this tutorial or all tutorials generally on udzone that you are having problems printing with?

RE: Page layout of Tutorial

January 28, 2002 by George Petrov
We will soon make a "Print Tutorial" feature available. So you can print it nicely without the UDzone framework.

Very convoluted

April 29, 2002 by pc pete

I've just worked through this tutorial; it does exactly what it says on the tin, but its very convoluted; I had to jump to several other pages (for example, to find out what JMail was). It assumes that you are working through a series of tutorials in order; most people (like me) won't..they'll have a single problem, and want a single solution.

Other than that, well done!

See all 7 Comments

You must me logged in to write a comment.