protected void btnforget_Click(object sender, EventArgs e) { using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext()) { var counter = from a in dataDB.Photo_CustomerRegistrationDetails where a.Email == txtEmail.Text select a; if (counter.Count()==1) { var getval = counter.FirstOrDefault(); EncryptedQueryString args = new EncryptedQueryString(); args["arg1"] = txtEmail.Text; string url = string.Format("http://*****:*****@gmail.com"); msg.To.Add(txtEmail.Text); msg.Subject = "Activation Mail From icons"; StringBuilder sb = new StringBuilder(); sb.Append("<table><tr><td colspan='2'>Hi, " +getval.Full_Name + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means <a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td> Email:</td><td>" + txtEmail.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>"); msg.Body = sb.ToString(); msg.IsBodyHtml = true; msg.Priority = MailPriority.High; MailSender ms = new MailSender(); ms.SendMailUsingGmail(msg); lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#006600"); lbResponse.Text = "Password Link sent to your Mail Id!"; } else { lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#CC0000"); lbResponse.Text = "Invalid Email Id!"; } } }
protected void btnRegister_Click(object sender, EventArgs e) { lbResponse.Text = string.Empty; //System.Threading.Thread.Sleep(100000000); if (cbterms.Checked) { int a = 0; if (cbsubscription.Checked) { a = 1; } using (PhotoProcessingDataContext dataDB = new PhotoProcessingDataContext()) { string path = "~/Images/Profile/default_person.jpg"; var counter = from b in dataDB.Photo_CustomerRegistrationDetails where b.Email == txtEmail.Text select b; if (counter.Count() == 0) { Photo_CustomerRegistrationDetailBL obj = new Photo_CustomerRegistrationDetailBL(0, txtEmail.Text, txtPassword.Text, 0, path, txtFullName.Text, 1, 0, a, a, DateTime.Now, DateTime.MaxValue, DateTime.MaxValue, 0, 0); if (obj.Insert()) { EncryptedQueryString args = new EncryptedQueryString(); args["arg1"] = txtEmail.Text; string url = string.Format("http://*****:*****@gmail.com"); msg.To.Add(txtEmail.Text); msg.Subject = "Activation Mail From icons"; StringBuilder sb = new StringBuilder(); sb.Append("<table><tr><td colspan='2'>Hi, " + txtFullName.Text + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you for registering with us! .</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click on the link below to activate your account:</td></tr><tr><td colspan='2'></td></tr><tr><td>Login URL :</td><td>" + url + "</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Click is not possible means <a href=" + url + ">click here</a></td></tr><tr><td colspan='2'></td></tr><tr><td>Account Detail:</td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'><table><tr><td> Email:</td><td>" + txtEmail.Text + "</td></tr><tr><td>Password:</td><td>" + txtPassword.Text + "</td></tr></table></td></tr><tr><td colspan='2'></td></tr><tr><td colspan='2'>Thank you,</td></tr><tr><td colspan='2'>Edit My Photos</td></tr><tr><td colspan='2'>www.i-constech.com</td></tr></table>"); msg.Body = sb.ToString(); msg.IsBodyHtml = true; msg.Priority = MailPriority.High; MailSender ms = new MailSender(); ms.SendMailUsingGmail(msg); lbResponse.Text = "Validation mail send to your Id. Please, Check to activate your account...!"; emptyfield(); } } else { lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230"); lbResponse.Text = "Email Id Already exist!"; } } } else { lbResponse.ForeColor = System.Drawing.ColorTranslator.FromHtml("#ff6230"); lbResponse.Text = "Check the terms & conditions"; } }