protected void Button1_Click(object sender, EventArgs e) { string gender = ""; Models.Connection con = new Models.Connection(); Models.UserRegister user = new Models.UserRegister(); user.UName = TextBox1.Text; user.UEmail = TextBox2.Text; user.UPass = TextBox3.Text; if (RadioButton1.Checked) { gender = "Male"; } else if (RadioButton2.Checked) { gender = "Female"; } user.UGender = gender; user.UContact = TextBox4.Text; user.signUp(user); Models.Email em = new Models.Email(); em.email = TextBox2.Text; em.Subject = "Thank You So Much For Registration"; em.Body = "testing Body"; //will be changed later em.SendEmail(em); Response.Write("<script>alert('Successfully Regsitered...check Your mail')</script>"); Models.ClearText ct = new Models.ClearText(); ct.ClearTextbox(TextBox1, TextBox2, TextBox3, TextBox4); }
protected void Button7_Click(object sender, EventArgs e) { Models.Email em = new Models.Email(); em.Subject = TextBox9.Text; em.Body = TextBox10.Text; em.email = TextBox8.Text; em.SendEmail(em); Response.Write("<script>alert('Send Successfully')</script>"); ct.ClearTextbox(TextBox8, TextBox9, TextBox10); }
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>"); } } }