CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Email forgotton password code.

Print topic Send  topic

Author Message
GRQNET
Posted: 05/22/2003, 8:45 PM

Hi,

Does anyone have the code necessary to email a lost or forgotten password.
I would like the user to be able to enter either their email address or
member name and then have the system email them their password.

My database is called: WTTMembership
The table is: members
The Login box on the login screen points to the "Member_Login" field.

Please keep in mind that I am a newbee.

Thanks!!

Anthony :)


Andrew Asher
Posted: 05/23/2003, 7:04 PM

Anthony,
(assuming your Using W2K and asp) what I have done is this.
I use the email address as the login so I dont have the need to have a
seperate request based on the login ID. But if you get it going for the
email value your more than 1/2 way there.

1: Create another table and call it Lost_Passwords. ( this will store all
password requests )
1a: Fields include User_Email, User_Login, User_IP, User_Requests_DateTime
2: Create a page called lost_password with a form on it called
Request_Password that has one text box on it that uses the Lost_password
table and the text box is called "Lost_Password_Email".
3: Create an On Click Send Email Event on the submit button. (High
light the submit button on the from you have created, Goto the Properties
window - click the Events Tab, go down to the On Click option, right click
this and select the Send Email option from the list. A Details window for
this will show at the bottom of the Properties window, you will need to put
something in here but we are going to alter the code directly anyway once
the event has been created.
4: Once the event has been created switch to Code View and go to the Events
section. See below for the code I use for this...
This took me a while to get my head around but... the CCDLookup statement
is doing this... Lookup and find the value in DBfield "User_Password" from
the DBtable called Members, Where the value in DBfield "User_Email" is = the
value in the form field called Lost_Password_Email

Your going to have to follow it through with your own field names etc but
the end result is that every request is stored in a DBtable and that the
mail is sent on click when the record is inserted in to the database. As
you can see I am also storing the IP address of the requester and the
date/time of the request for the lost password.

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::
Function Request_Password_Insert_OnClick() 'Request_Password_Insert_OnClick
@5-C1C5D39B

'Send Email @11-144195CC
With CreateObject("CDONTS.NewMail")
.From = "you@yourdomain.com"
.To = Request_Password.Email.Text
.Subject = "Your Password as Requested"
.Body = "Hi, your password is: " &
CCDlookup("User_password","Members","User_Email="&CCToSQL(request_Password.E
mail.Value,"text"),DBWttMembership)& "Click here to sign in:
http://www.yourwebsite.com/login.asp";
.BodyFormat = 1
.MailFormat = 1
.Send
End With
'End Send Email
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::
End Function 'Close Request_Password_Insert_OnClick @5-54C34B28


"GRQNET" <Webmaster@grq.net> wrote in message
news:bak5gq$fd9$1@news.codecharge.com...
> Hi,
>
> Does anyone have the code necessary to email a lost or forgotten password.
> I would like the user to be able to enter either their email address or
> member name and then have the system email them their password.
>
> My database is called: WTTMembership
> The table is: members
> The Login box on the login screen points to the "Member_Login" field.
>
> Please keep in mind that I am a newbee.
>
> Thanks!!
>
> Anthony :)
>
>
>

GRQNET
Posted: 05/26/2003, 10:28 PM

Thanks Andrew,
I tried the code, but I keep getting the following error:

Object doesn't support this property or method: 'Request_Password.Email'

What did I do wrong?

My database connection is called: WTTMembership
The table of members is called: members
The field that contains the LoginId is called: member_login
The field that contains the Password is called: member_password
The field that contains the email address is just called: email

I created the new table you asked called Lost_Passwords
That table contains the four fields you said.
User_Email, User_Login, User_IP, User_Requests_DateTime

I created the page called "lost_passwords" and form called "Request
Password"
The Text Box in the form is called: Lost_Password_Email

One thing. I originally added the code to the "Submit" button as you said,
however, when I ran the page, only the ADD button showed up.. So, I moved
the code to the ADD button. This did not work either and gave me the error
above.

Thanks for any help!!

Anthony.







"Andrew Asher" <Andrew.Asher@clear.net.nz> wrote in message
news:bamjv8$ohq$1@news.codecharge.com...
> Anthony,
> (assuming your Using W2K and asp) what I have done is this.
> I use the email address as the login so I dont have the need to have a
> seperate request based on the login ID. But if you get it going for the
> email value your more than 1/2 way there.
>
> 1: Create another table and call it Lost_Passwords. ( this will store
all
> password requests )
> 1a: Fields include User_Email, User_Login, User_IP,
User_Requests_DateTime
> 2: Create a page called lost_password with a form on it called
> Request_Password that has one text box on it that uses the Lost_password
> table and the text box is called "Lost_Password_Email".
> 3: Create an On Click Send Email Event on the submit button. (High
> light the submit button on the from you have created, Goto the Properties
> window - click the Events Tab, go down to the On Click option, right click
> this and select the Send Email option from the list. A Details window for
> this will show at the bottom of the Properties window, you will need to
put
> something in here but we are going to alter the code directly anyway once
> the event has been created.
> 4: Once the event has been created switch to Code View and go to the
Events
> section. See below for the code I use for this...
> This took me a while to get my head around but... the CCDLookup statement
> is doing this... Lookup and find the value in DBfield "User_Password"
from
> the DBtable called Members, Where the value in DBfield "User_Email" is =
the
> value in the form field called Lost_Password_Email
>
> Your going to have to follow it through with your own field names etc but
> the end result is that every request is stored in a DBtable and that the
> mail is sent on click when the record is inserted in to the database. As
> you can see I am also storing the IP address of the requester and the
> date/time of the request for the lost password.
>
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> ::::::::::::::::::::::::::::::
> Function Request_Password_Insert_OnClick()
'Request_Password_Insert_OnClick
> @5-C1C5D39B
>
> 'Send Email @11-144195CC
> With CreateObject("CDONTS.NewMail")
> .From = "you@yourdomain.com"
> .To = Request_Password.Email.Text
> .Subject = "Your Password as Requested"
> .Body = "Hi, your password is: " &
>
CCDlookup("User_password","Members","User_Email="&CCToSQL(request_Password.E
> mail.Value,"text"),DBWttMembership)& "Click here to sign in:
> http://www.yourwebsite.com/login.asp";
> .BodyFormat = 1
> .MailFormat = 1
> .Send
> End With
> 'End Send Email
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> ::::::::::::::::::::::::::::::
> End Function 'Close Request_Password_Insert_OnClick @5-54C34B28
>
>
> "GRQNET" <Webmaster@grq.net> wrote in message
>news:bak5gq$fd9$1@news.codecharge.com...
> > Hi,
> >
> > Does anyone have the code necessary to email a lost or forgotten
password.
> > I would like the user to be able to enter either their email address or
> > member name and then have the system email them their password.
> >
> > My database is called: WTTMembership
> > The table is: members
> > The Login box on the login screen points to the "Member_Login" field.
> >
> > Please keep in mind that I am a newbee.
> >
> > Thanks!!
> >
> > Anthony :)
> >
> >
> >
>
>

GRQNET
Posted: 05/26/2003, 11:15 PM

Hi Andrew,

After looking over the code, I realized that there was a typo for the name
of the field "Lost_Password_Email" and the 'Request_Password.Email'. I
changed that to read: 'Request_Password.Lost_Password_Email" and I also
changed the code a bit to refect my tables and it worked.
Thanks again.

Anthony



"GRQNET" <Webmaster@grq.net> wrote in message
news:baut18$b2p$1@news.codecharge.com...
> Thanks Andrew,
> I tried the code, but I keep getting the following error:
>
> Object doesn't support this property or method: 'Request_Password.Email'
>
> What did I do wrong?
>
> My database connection is called: WTTMembership
> The table of members is called: members
> The field that contains the LoginId is called: member_login
> The field that contains the Password is called: member_password
> The field that contains the email address is just called: email
>
> I created the new table you asked called Lost_Passwords
> That table contains the four fields you said.
> User_Email, User_Login, User_IP, User_Requests_DateTime
>
> I created the page called "lost_passwords" and form called "Request
> Password"
> The Text Box in the form is called: Lost_Password_Email
>
> One thing. I originally added the code to the "Submit" button as you said,
> however, when I ran the page, only the ADD button showed up.. So, I moved
> the code to the ADD button. This did not work either and gave me the
error
> above.
>
> Thanks for any help!!
>
> Anthony.
>
>
>
>
>
>
>
> "Andrew Asher" <Andrew.Asher@clear.net.nz> wrote in message
>news:bamjv8$ohq$1@news.codecharge.com...
> > Anthony,
> > (assuming your Using W2K and asp) what I have done is this.
> > I use the email address as the login so I dont have the need to have a
> > seperate request based on the login ID. But if you get it going for the
> > email value your more than 1/2 way there.
> >
> > 1: Create another table and call it Lost_Passwords. ( this will store
> all
> > password requests )
> > 1a: Fields include User_Email, User_Login, User_IP,
> User_Requests_DateTime
> > 2: Create a page called lost_password with a form on it called
> > Request_Password that has one text box on it that uses the Lost_password
> > table and the text box is called "Lost_Password_Email".
> > 3: Create an On Click Send Email Event on the submit button. (High
> > light the submit button on the from you have created, Goto the
Properties
> > window - click the Events Tab, go down to the On Click option, right
click
> > this and select the Send Email option from the list. A Details window
for
> > this will show at the bottom of the Properties window, you will need to
> put
> > something in here but we are going to alter the code directly anyway
once
> > the event has been created.
> > 4: Once the event has been created switch to Code View and go to the
> Events
> > section. See below for the code I use for this...
> > This took me a while to get my head around but... the CCDLookup
statement
> > is doing this... Lookup and find the value in DBfield "User_Password"
> from
> > the DBtable called Members, Where the value in DBfield "User_Email" is =
> the
> > value in the form field called Lost_Password_Email
> >
> > Your going to have to follow it through with your own field names etc
but
> > the end result is that every request is stored in a DBtable and that the
> > mail is sent on click when the record is inserted in to the database.
As
> > you can see I am also storing the IP address of the requester and the
> > date/time of the request for the lost password.
> >
> >
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> >
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> > ::::::::::::::::::::::::::::::
> > Function Request_Password_Insert_OnClick()
> 'Request_Password_Insert_OnClick
> > @5-C1C5D39B
> >
> > 'Send Email @11-144195CC
> > With CreateObject("CDONTS.NewMail")
> > .From = "you@yourdomain.com"
> > .To = Request_Password.Email.Text
> > .Subject = "Your Password as Requested"
> > .Body = "Hi, your password is: " &
> >
>
CCDlookup("User_password","Members","User_Email="&CCToSQL(request_Password.E
> > mail.Value,"text"),DBWttMembership)& "Click here to sign in:
> > http://www.yourwebsite.com/login.asp";
> > .BodyFormat = 1
> > .MailFormat = 1
> > .Send
> > End With
> > 'End Send Email
> >
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> >
>
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
> > ::::::::::::::::::::::::::::::
> > End Function 'Close Request_Password_Insert_OnClick @5-54C34B28
> >
> >
> > "GRQNET" <Webmaster@grq.net> wrote in message
> >news:bak5gq$fd9$1@news.codecharge.com...
> > > Hi,
> > >
> > > Does anyone have the code necessary to email a lost or forgotten
> password.
> > > I would like the user to be able to enter either their email address
or
> > > member name and then have the system email them their password.
> > >
> > > My database is called: WTTMembership
> > > The table is: members
> > > The Login box on the login screen points to the "Member_Login" field.
> > >
> > > Please keep in mind that I am a newbee.
> > >
> > > Thanks!!
> > >
> > > Anthony :)
> > >
> > >
> > >
> >
> >
>
>


   


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

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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