Solved

Retrieve forgotten Password

Posted on 2004-09-22
3
169 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 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