CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Email Forgotten Password

Print topic Send  topic

Author Message
Juergen Oschadleus
Posted: 02/23/2004, 7:39 PM

I'm surprised not to have found information in the knowledge bases, forums
and tutorials on handling forgotten passwords. If a user forgets his/her
password for the system, I'd like a page where they enter their username.
The system checks the database, and e-mails the matching password to the
e-mail address stored against that record.

It must be possible, but I can't figure out how. Your assistance please....

Juergen

Bubba

Posts: 33
Posted: 02/23/2004, 8:07 PM

I too am having a mountain of problems trying to get this feature to work. I am using CCS2 / ASP

The previous postings in the archive don't seem to make any sense - I think they relate to an earlier version of CC

Any help would be appreciated
View profile  Send private message
DonB
Posted: 02/23/2004, 8:14 PM

You need an email component. ASP does not provide one itself. Your
internet provider should have one or more available (see www.persits.com for
details on their component.

It's pretty easy, really, once you have the compoent. Just call
CreateObject to instantiate it, insert the from, to, subject and message
text then call the Send method.

When you have the userid, you just use the CCDLookup() function to get their
password or other details out of the database. Assemble that into a message
and send it.

I plan to put some code on my site's download area to do this. It's a
matter of getting around to it. The above info should get you started
anyway.

--
DonB

http://www.gotodon.com/ccbth


"Juergen Oschadleus" <juergeno@actknowSTOPSPAM.com> wrote in message
news:c1eh0t$1mg$1@news.codecharge.com...
> I'm surprised not to have found information in the knowledge bases, forums
> and tutorials on handling forgotten passwords. If a user forgets his/her
> password for the system, I'd like a page where they enter their username.
> The system checks the database, and e-mails the matching password to the
> e-mail address stored against that record.
>
> It must be possible, but I can't figure out how. Your assistance
please....
>
> Juergen
>
>

Mark
Posted: 04/18/2004, 9:44 PM

I modofied this code from aspin, and works great for ASP:

Page1-----
<html>
<body>
<form method=post action="forgot_pass.asp">
<center> <h2> Forgot Password! Enter your Email Address</h2> <br>
<input type=text name=email> <br>
<input type="submit" value="Enter Your Email Address"> <input type="reset" value="Clear Value">
</center>
</form>
</body>
</html>

Page2-------
dim user_password,UserID,objco,objrs,sql,bool

'storing the value of email in eid variable
eid=trim(request.form("email"))
if eid="" then
response.redirect "forgot_pass.asp"
end if
'making conncetion to database

Set objConn = CreateObject("ADODB.Connection")
your connection string

'making recordset
set objrs=server.createObject("adodb.recordset")

'making query for seraching the email address from database
sql="select * from users where email= '"&eid&"' "
objrs.open sql,objConn,1,2

if not objrs.eof then
bool=true
while not objrs.eof
user_password=objrs("user_password")
user_login=objrs("user_login")
objrs.movenext
wend

'sending password via CDO

Dim objCDO, txtmessage

Set objCDO = Server.CreateObject("CDO.Message")

objCDO.To = eid
objCDO.From = "support@yourdomain.com.au"
objCDO.cc = "support@yourdomain.com.au"

txtMessage = "========================================================" & CHR(10)
txtMessage = txtMessage & "Your lost password and username!" & CHR(10)
txtMessage = txtMessage & "========================================================" & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & (Now) & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "Your IP has been logged:"
txtMessage = txtMessage & " " & Request.ServerVariables("REMOTE_ADDR") & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "Your Password:"
txtMessage = txtMessage & " " & user_password & CHR(10)
txtMessage = txtMessage & "Your UserName:"
txtMessage = txtMessage & " " & user_login & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "To login to the website, please use the following link:" & CHR(10)
txtMessage = txtMessage & "http://www.yourdomain.com.au/" & CHR(10)

objCDO.Subject = "Your password!"
objCDO.TextBody = txtMessage
objCDO.Send
Set objCDO = Nothing

Response.write"Your Password and username has been emailed to your address, please check your email"

'if record does not exist

else
bool=false
Response.write"Sorry your email does not exist or check your email address"

end if

Hope this helps someone :)

Karan Oberoi
Posted: 06/17/2004, 10:26 AM

hey guys does sumone know how to do this in PHP.. because CDONTS component of ASP is not supported by free hosts..
DonB
Posted: 06/22/2004, 2:51 PM

Most commercial hosting sites will offer an addon like Persits ASPemail or
some other alternative. Don't know why you said "PHP", because PHP has its
own built-in mail functions, and this is a non issue in that case.

--
DonB

http://www.gotodon.com/ccbth


<KaranOberoi@forum.codecharge (Karan Oberoi)> wrote in message
news:640d1d42a32d04@news.codecharge.com...
> hey guys does sumone know how to do this in PHP.. because CDONTS
component of
> ASP is not supported by free hosts..
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

NBDesign
Posted: 06/22/2004, 3:35 PM

Ok, this is simple if you are on a windows server that has not disabled CDO. This was taken from my site... sorry for allt he extra info...

HTML:

<table cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td>
<!-- BEGIN Record getpass -->
<form name="{HTMLFormName}" action="{Action}" method="post">
<p align="center"><strong><font size="3"><font color="#505050">Retrieve
your password.</font></font></strong></p>

<table class="GiantStepsFormTABLE" cellspacing="0" cellpadding="3" align="center" width="300">
<!-- BEGIN Error -->
<tr>
<td class="GiantStepsErrorDataTD" colspan="2">{Error}</td>
</tr>
<!-- END Error -->
<tr>
<td class="" valign="top">Enter Your Email </td>
<td class=""><input class="GiantStepsInput" value="{Email}" name="{Email_Name}"></td>
</tr>

<tr>
<td valign="top" height="5"><img id="Image1" src="images/spacer.gif" name="Image1"></td>
<td height="5"></td>
</tr>

<tr>
<td class="GiantStepsFooterTD" nowrap align="middle" colspan="2" style="BACKGROUND-COLOR: #efedf0">
<!-- BEGIN Button Button_Insert --><input class="GiantStepsButton" type="submit" value="Retreive Your Password" name="{Button_Name}"><!-- END Button Button_Insert --></td>
</tr>

</table>

</form>
<!-- END Record getpass --></td>
</tr>

</table>

ASP:

Dim pass

pass = CCDLookUp("pwid", "customers", "customerEmail=" & CCToSQL(getpass.Email.Value ,"Text"), DBnbdesign)

With CreateObject("CDONTS.NewMail")
.From = "Your@Email.com"
.To = getpass.Email.Text
.Subject = "Your Password"
.Body = "Here is you password: " & pass
.BodyFormat = 1
.MailFormat = 0
.Send
End With
'End Send Email
DonB
Posted: 06/22/2004, 4:00 PM

That was the OP's initial problem - his server does not have CDO. The
Persits mailer component basically involves the same set of properties as
CDONTS. The PHP mail function is less straightforward, as you have to
assemble the "header" as a string by concatenating each line.

--
DonB

http://www.gotodon.com/ccbth


"NBDesign" <NBDesign@forum.codecharge> wrote in message
news:640d8b43d1c32a@news.codecharge.com...
> Ok, this is simple if you are on a windows server that has not disabled
CDO.
> This was taken from my site... sorry for allt he extra info...
>

ravi
Posted: 07/04/2004, 5:46 AM

:-X

I am getting this error in sending password through mail please give me a solution

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.
hp[io[u[iu
Posted: 07/12/2004, 2:28 AM

8-)O:):-@:-O:-X:-{}:*):*)8-):(:-):-):-P
Tecolote
Posted: 05/31/2005, 12:49 PM

8-) The code of NBDesign works great !!!,
but i lost a lot of time looking for a valid ("ADODB.Connection") for SQL SERVER, so here is the code, for me and for all of you.

My complete code look like that

PAGE 2- forgot_pass.asp

<%
dim user_password,UserID,objco,objrs,sql,bool

'storing the value of email in eid variable
eid=trim(request.form("email"))
if eid="" then
response.redirect "forgot_pass.asp"
end if
'making conncetion to database

Set objConn = Server.CreateObject( "ADODB.Connection" )
'your connection string
objConn.Open "PROVIDER=SQLOLEDB;DATASOURCE=portal2;UID=benjy;PWD=04040"

'making recordset
set objrs=server.createObject("adodb.recordset")

'making query for seraching the email address from database
sql="select * from dbo.users where email= '"&eid&"' "
objrs.open sql,objConn,1,2

if not objrs.eof then
bool=true
while not objrs.eof
user_password=objrs("user_password")
user_login=objrs("user_login")
objrs.movenext
wend

'sending password via CDO

Dim objCDO, txtmessage

Set objCDO = Server.CreateObject("CDO.Message")

objCDO.To = eid
objCDO.From = "support@yourdomain.com.au"
objCDO.cc = "support@yourdomain.com.au"

txtMessage = "========================================================" & CHR(10)
txtMessage = txtMessage & "Your lost password and username!" & CHR(10)
txtMessage = txtMessage & "========================================================" & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & (Now) & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "Your IP has been logged:"
txtMessage = txtMessage & " " & Request.ServerVariables("REMOTE_ADDR") & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "Your Password:"
txtMessage = txtMessage & " " & user_password & CHR(10)
txtMessage = txtMessage & "Your UserName:"
txtMessage = txtMessage & " " & user_login & CHR(10)
txtMessage = txtMessage & CHR(10)
txtMessage = txtMessage & "To login to the website, please use the following link:" & CHR(10)
txtMessage = txtMessage & "http://www.yourdomain.com.au/" & CHR(10)

objCDO.Subject = "Your password!"
objCDO.TextBody = txtMessage
objCDO.Send
Set objCDO = Nothing

Response.write"Your Password and username has been emailed to your address, please check your email"

'if record does not exist

else
bool=false
Response.write"Sorry your email does not exist or check your email address"

end if
%>

Notes:
Obviusly, the Table is called: "users", the mailField is called "email", the passField is called "user_password", and the loginField is called "user_login"

Oper


Posts: 1195
Posted: 05/31/2005, 5:45 PM

Like Donb said the code is very simple to acomplish:

First Check teh Email object they are using. (there is always one)
Check this Thread:
http://www.globaldevelop.com/GlobalDevelop/forum/forum_...asp?TID=34&PN=1
2 Simple Function, only you have to do is During any Event, even on validate call that function with the respective parameter and Done.

Let me knwo if you wnat to go deeper or need more help



http://www.GlobalDevelop.com
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.