-
Notifications
You must be signed in to change notification settings - Fork 0
/
Password_Recovery.aspx.cs
57 lines (54 loc) · 1.97 KB
/
Password_Recovery.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace HomeoClinic
{
public partial class Password_Recovery : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Models.Email ee = new Models.Email();
Models.Connection con = new Models.Connection();
SqlCommand com = new SqlCommand("select * from login", con.getConnection());
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
ee.email = TextBox1.Text;
string em = rd["Email"].ToString();
string pass = rd["Password"].ToString();
if (ee.email == em)
{
ee.Body = pass;
ee.Subject = "Password Recovery";
//ee.email = em;
ee.SendEmail(ee);
Response.Write("<script>alert('Email Sent Successfully')</script>");
}
}
}
}
}
/*Models.Email ee = new Models.Email();
Models.Connection con = new Models.Connection();
SqlCommand com = new SqlCommand("select * from login", con.getConnection());
SqlDataReader rd = com.ExecuteReader();
while (rd.Read())
{
string em = rd["Email"].ToString();
string pass = rd["Password"].ToString();
if (ee.email == em)
{
ee.Body = pass;
ee.Subject = "Password Recovery";
ee.email = em;
ee.SendEmail(ee);
Response.Write("<script>alert('Email Sent Successfully')</script>");
}
}*/