CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> .NET

 Help adding "Forgot Password" to Login form (email password to user)

Print topic Send  topic

Author Message
gmicalzoma

Posts: 6
Posted: 03/12/2007, 2:03 PM

:-/

Hi,

I'm trying to add a "Forgot Password" feature to the Login form made by Authentication Builder in CCS for ASP.Net (VB.net) framework 2.0.

I will like when a person clicks on the link to go to a page with a box where they can enter their Email Address and if it exists in the database the password will be emailed to that Email address.

I'm using:
Table: users
Fields: user_id, username, password, email.

Any ideas or has someone donnit already?

Thanks in advance,

Jay
View profile  Send private message
Stan
Posted: 03/15/2007, 12:06 AM

You should create a Record form and assign on the Insert button OnClick event couple actions.

1) Dlookup action for extracting the password from DB by entered email
2) If #1 was successful send the e-mail to the user by using Send E-mail action.

Stan
desert


Posts: 24
Posted: 07/05/2008, 5:40 AM

Quote Stan:
You should create a Record form and assign on the Insert button OnClick event couple actions.

1) Dlookup action for extracting the password from DB by entered email
2) If #1 was successful send the e-mail to the user by using Send E-mail action.

Stan

Do you have an examplecode?
View profile  Send private message
tsgroman


Posts: 64
Posted: 07/05/2008, 9:41 PM

This should get you headed in the right direction...

>>>>>>>>>>>>>>>>>

Dim theEmailAddress as string
Dim thePassword as string

theEmailAddress = RetrievePasswordTextBox1.Text
thePassword = (New TextField("",Settings.Connection1DataAccessObject.ExecuteScalar("SELECT Password FROM Users WHERE Email = '" & theEmailAddress & "'"))).GetFormattedValue()

If thePassword Is Nothing Then
'Tell user there is no password.
Else
Dim message As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
message.From = "you@yourserver.com"
message.To = theEmailAddress
message.Subject = "Password Retrieval"
message.Body = "Dear User:" & vbCrLf & vbCrLf
message.Body = message.Body & "Your Account Access password is : " & thePassword & vbCrLf & vbCrLf
message.Body = message.Body & "Login to your account at - http://www.yourserver.com/login.aspx";
message.BodyFormat = System.Web.Mail.MailFormat.Text
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "you@yourserver.com") 'set your username here
message.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "yourpassword") 'set your password here
System.Web.Mail.SmtpMail.SmtpServer = "mail.yourserver.com"
System.Web.Mail.SmtpMail.Send(message)
End If

>>>>>>>>>>>>>

PM me if you have any questions
View profile  Send private message
kescott


Posts: 49
Posted: 08/04/2008, 6:50 PM

How do you change your code from VB.NET to C#.NET
_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
View profile  Send private message
kescott


Posts: 49
Posted: 08/26/2008, 1:56 PM

I finally got the C# code to work. Any ideas how to get this working more efficient?:-D


//Button Button_DoSearch Event OnClick. Action Custom Code @6-2A29BDB7
// -------------------------

string s_email;
string thePassword;
string theUsername;

s_email = NewRecord1s_email.Text;

thePassword = (new TextField("",Settings.vid_connectionDataAccessObject.ExecuteScalar("SELECT password FROM Logins WHERE email = '" + s_email + "'"))).GetFormattedValue();

theUsername = (new TextField("",Settings.vid_connectionDataAccessObject.ExecuteScalar("SELECT login FROM Logins WHERE email = '" + s_email + "'"))).GetFormattedValue();

{System.Web.Mail.MailMessage message=new System.Web.Mail.MailMessage();
message.From = "ccss.id.mgmt@core.com";
message.To = NewRecord1s_email.Text;
message.Subject = NewRecord1s_email.Text;
message.Body = "Dear User: " + theUsername + "\n\n";
message.Body = message.Body + "Your password is: "+ thePassword +"\n\n\n";
message.Body = message.Body + "Login to your account at - http://ccss.core.com/vidmanagement/Login.aspx";;

message.BodyFormat = System.Web.Mail.MailFormat.Text;
System.Web.Mail.SmtpMail.SmtpServer = "smtp.core.com";
System.Web.Mail.SmtpMail.Send(message);}
// -------------------------
//End Button Button_DoSearch Event OnClick. Action Custom Code
_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
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.