Solved

Retrieve forgotten Password

Posted on 2004-09-22
3
161 Views
Last Modified: 2010-04-25
I want to create a page  that the user inputs their emaill address and then the page will search a table called user for that emaill address and then email their password to their emaill address.

I am using classic ASP not .NET with a SQL backend.

Is their an extentsion that is avvalible or is it a hardcoding job?

willa

0
Comment
Question by:willa666
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
rockmansattic earned 500 total points
ID: 12122144
Dont know of any extensions for DW that incorperates asp and SQL,
But this would not be that hard to do handcoding.

the mailer would have to be coded and it would look something like this:

If Request.ServerVariables("Request_Method") = "POST" then


Dim objMail
Dim strBody

 Set objMail = Server.CreateObject("CDONTS.NewMail")

    objMail.From    = Request.Form("appemailaddress")
    objMail.Subject = "New Application Request"
    objMail.To      = request.form("emailaddress")

     firstName             = Request.Form("fName")
     Lastname             = Request.Form("lname")
     emailaddress      = Request.Form("emailaddress")
      

     HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
     HTML = HTML & "<html>"
     HTML = HTML & "<head>"
     HTML = HTML & "<title>Sending CDONTS Email Using HTML</title>"
     HTML = HTML & "</head>"
     HTML = HTML & "<body bgcolor=""FFFFFF"">"
     HTML = HTML & "<font size =""2"" face=""Arial"">"
     HTML = HTML & "<b>" & firstName & vbCrLf & lastname& vbCrLf & " has submitted an application ." & "<br>"
       HTML = HTML & "It was submitted " & submitted & vbCrLf & "</b>" & "<br>" & "<br>"
     HTML = HTML & "</font>"
       HTML = HTML & "Email Address: " & emailaddress & "<br>"      
       HTML = HTML & "Phone Number: " & phone & "<br>"              
       HTML = HTML & "<font size =""3"">"
       HTML = HTML & "Address" & "<br>" & "</font>"
       HTML = HTML & "<hr width=""200"" size=""2"" align=""left"">"
       HTML = HTML & address & "<br>"
       HTML = HTML & city & ", " & appstate & vbCrLf & zip & "<br>" & "<br>"
       HTML = HTML & "Education: " & education & "<br>"
       HTML = HTML & "College: " & college & "<br>"
       HTML = HTML & "Graduation Date: " & graddate & "<br>"      
       HTML = HTML & "Degree: " & degree & "<br>"      
       HTML = HTML & "Date of Birth: " & dob & "<br>"              
       HTML = HTML & "Comments: " & comments & "<br>"
     HTML = HTML & "<p align = ""center"">This email has been auto-generated; Please do not respond.</p>"
     HTML = HTML & "</body>"
     HTML = HTML & "</html>"

     objMail.BodyFormat=0 '0= HTML, 1=Text
     objMail.MailFormat=0


     objMail.Body = HTML
    objMail.Send

Response.write("Mail was Sent")

'You must always do this with CDONTS.
 set objMail = nothing


End If

Also,
once to have connected the sql and asp, the login would be too hard, there are tons of resources online,

Rockman

0
 
LVL 10

Expert Comment

by:rockmansattic
ID: 12122291
The way I would tackel it via hand codeing would be somthing like this:

<%
If Request.ServerVariables("Request_Method") = "POST" then

'get the text form emailaddress and saves it to a variable
var_emailaddress = request.form("emailaddress")

'connect to your database
'then run this sql

SELECT emailaddress, password  FROM users WHERE emailadress LIKE 'var_emailaddress'


'then you will have to find wheather the emailaddress is valid
'if so then set teh  password to variables and send email

if (yourrecordsetname).Fields.item("emailaddress").Value <> "" then

var_password = (yourrecordsetname).Fields.item("password").Value

Dim objMail
Dim strBody

 Set objMail = Server.CreateObject("CDONTS.NewMail")

    objMail.From    = "your email address"
    objMail.Subject = "your password"
    objMail.To      = var_emailaddress


     

     HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
     HTML = HTML & "<html>"
     HTML = HTML & "<head>"
     HTML = HTML & "<title>Sending Email</title>"
     HTML = HTML & "</head>"
     HTML = HTML & "<body bgcolor=""FFFFFF"">"
     HTML = HTML & "<p align = ""center"">This email has been auto-generated; Please do not respond.</p>"
     HTML = HTML & "</body>"
     HTML = HTML & "</html>"

     objMail.BodyFormat=0 '0= HTML, 1=Text
     objMail.MailFormat=0


     objMail.Body = HTML
    objMail.Send

Response.write("Mail was Sent")


 set objMail = nothing

'redirect to your password has been sent page ro something
Response.Redirect("password_sent")

'ends the valid email and sends email
end if

'emai wasnt valid
else
  response.redirect("wrong_email.html")

end if




this is a rough guidline and was written without testing, becasue I dont know how you are connecting the sql with asp, and the connection names would be a mess.  
I hope this gets you in the right direction.

Rockman





0
 
LVL 1

Author Comment

by:willa666
ID: 12154305
JI rockman

Thanks matey thank works a treat!

wila :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now