Solved

Retrieve forgotten Password

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

911 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

17 Experts available now in Live!

Get 1:1 Help Now