473,387 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Forgot Password

Hi There,
I have a login form which includes Username, Password and Email Id.
If user forgots its password then user should get the password through email.
Can anyone help me?

Thanx in advance
Mar 24 '08 #1
2 1367
Hi There,
I have a login form which includes Username, Password and Email Id.
If user forgots its password then user should get the password through email.
Can anyone help me?

Thanx in advance

Look at the tip o the week by Frinny he has an article on sending E-Mails via VB


hope this helps
Mar 24 '08 #2
parshupooja
159 100+
try this, it works
Expand|Select|Wrap|Line Numbers
  1. protected void Submit_Click(object sender, EventArgs e)
  2.     {
  3.         string FieldRepId = UserName.Text;
  4.         bool result = SendEmail(userid);
  5.         if (result == true)
  6.             Response.Redirect("Default.aspx");
  7.         else UserName.Text = "";
  8.         lblStatus.Visible = true;
  9.         lblStatus.Text = "Error Sending Email.";
  10.  
  11.     }
  12.     private bool SendEmail(string userid)
  13.     {      string query = "GetEmail";
  14.         string connectionString = (string)ConfigurationManager.ConnectionStrings["Euro_FieldRep"].ConnectionString;
  15.         SqlConnection myConnection = new SqlConnection(connectionString);
  16.         SqlCommand myCommand = new SqlCommand(query, myConnection);
  17.  
  18.         myCommand.CommandType = CommandType.StoredProcedure;
  19.         myCommand.Parameters.AddWithValue("@userid", userid);
  20.     if (myConnection.State!=ConnectionState.Open) { myConnection.Open(); }
  21.                try
  22.         {
  23.         if (myConnection.State != ConnectionState.Open) { myConnection.Open(); }
  24.  
  25.          IDataReader drEmailReader = myCommand.ExecuteReader();
  26.  
  27.         while (drEmailReader.Read())
  28.         {
  29.             string email = drEmailReader[0].ToString().Trim();
  30.             string password = drEmailReader["password"].ToString();
  31.             string message = string.Format(" Your password is {0} . This is automatic Reply, Please do not reply ", password);
  32.  
  33.             Utilities.SendMail("noreply@xxx.com", email, "", "password recovery", message);
  34.             lblStatus.Text = "Mail has Been sent sucessfully.";
  35.  
  36.         }
  37.                   return true;
  38.     }
  39.     catch (Exception ex)
  40.     {
  41.         return false;
  42.         lblStatus.Text = "Error Sending Email.";
  43.     }
  44.  
  45.     }
Hi There,
I have a login form which includes Username, Password and Email Id.
If user forgots its password then user should get the password through email.
Can anyone help me?

Thanx in advance
Mar 24 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Ini | last post by:
Hi, I forgot my password for an Access-database. Is there any way to open it or export structure and / or data? I'm using Access97. Thanks
2
by: DDK | last post by:
I really wish there were some examples explaining how to create a forgot password email link system when you encrypt a password in a database and use ASP.NET/C# preferably. Since the password is...
0
by: paulmac106 | last post by:
Hi, I was able to get the login control to work with my custom membership provider (a sql db table), but the "remember me" function and the function that will send a user their forgotten...
2
by: kuldeep singh sethi | last post by:
Hey Friends, I have searched in google to get information about "forgot password ?". but didn't satisfy.i need help for this code. i want code for forgot password. I have no idea how to send...
2
by: chaos | last post by:
Hi all, i need help in this forgot password page, as the error message is show in another page cause the arrangement of the design in a mess. As i want to show the error message on the forgot...
1
by: Peterwkc | last post by:
Hello all respective fellows, i have a assignment where i need to create website that allow customer to order online with theusername and password. My situation is when user forgot the password,...
1
by: groupie | last post by:
Hi, I'd like to know how to implement the "Forgot Password" feature on many websites which require a login, exactly like this ebay example:...
6
by: lightyagami | last post by:
how to code the "forgot your password?" in php??? i have a login account where i want to display also the "forgot your password?" but i dont know how to code it in PHP...can u help me?
10
matheussousuke
by: matheussousuke | last post by:
Hi, guys, I'm developing a script and it's almost done, just left two little things: Forgot password option Change password option About forgot password: The user can use as many user names...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.