Subscribe to Subscribers
Talk to Webmaster Tony John

Online Members

Shine S
More...

Resources » Code Snippets » C# Syntax

Forget Password recovery by mail


Posted Date:     Category: C# Syntax    
Author: Member Level: Bronze    Points: 10



 


This project code for to get Forget Password recovery by mail
-------------------------------------------------------------------------

      protected void Button2_Click(object sender, EventArgs e)
{
rs.get_username = TextBox3.Text;
rs.get_email = TextBox4.Text;
int i = rs.pwd_recovery();
if (TextBox3.Text != "" & TextBox4.Text != "")
{
if (i == 2)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "aa", "");

}
else
{
recovery2();
}

}
else
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "aa", "");
}

}
public void recovery2()
{

rs.get_username = TextBox3.Text;
rs.get_email = TextBox4.Text;
DataSet ds = rs.get_pwd();
if (ds.Tables[0].Rows.Count != 0)
{

Label2.Text = ds.Tables[0].Rows[0]["u_name"].ToString();
Label3.Text = ds.Tables[0].Rows[0]["pwd"].ToString();
Label4.Text = ds.Tables[0].Rows[0]["mailid"].ToString();
}
try
{
SmtpClient smclient = new SmtpClient();
MailMessage message = new MailMessage();

try
{
MailAddress fromaddress = new MailAddress("arpita@yahoo.com", "");
smclient.Host = "photo48";
smclient.Port = 25;
message.From = fromaddress;
message.To.Add(TextBox4.Text);
message.Subject = "Password Recovery";
message.IsBodyHtml = true;
string body=("u_name=" + Label2.Text+ "pwd=" +Label3.Text+ "mailid=" + Label4.Text + " ");
message.Body = body;
smclient.Send(message);
Page.ClientScript.RegisterStartupScript(this.GetType(), "msg", "");

}
catch(SmtpException ex)
{

}
}
catch(Exception e)
{

}
}





Did you like this resource? Share it with your friends and show your love!


Responses to "Forget Password recovery by mail"

No responses found. Be the first to respond...

Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Using Delegate with Generic List to find an Item(s)
    Previous Resource: Check if a number is prime or not!
    Return to Resources
    Post New Resource
    Category: C# Syntax


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    (No tags found.)
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.