protected void btn_submit_Click(object sender, EventArgs e) { try { CONTACTUS obj = new CONTACTUS(); obj.CONTACT_NAME = BLL.ReplaceQuote(txt_yourname.Text); obj.CONTACT_EMAIL = BLL.ReplaceQuote(txt_email.Text); obj.CONTACT_MESSAGE = BLL.ReplaceQuote(txt_comments.Text); obj.CONTACT_MODIFIEDBY = 1; obj.CONTACT_PHONENUMBER = txt_phonenumber.Text; obj.CONTACT_SUBJECT = BLL.ReplaceQuote(txt_subject.Text); DataTable dt = BLL.CONTACT_EMAIL(obj); DataTable dt_contact = new DataTable(); bool status = BLL.INSERTCONTACT(obj); if (status == true) { BLL.ShowMessage(this, "Thank you for contacting us, one of our executive will reach you soon"); clearcontrols(); } else { BLL.ShowMessage(this, "Please contact administrator"); clearcontrols(); } MailMessage mailmessage = new MailMessage(); mailmessage.IsBodyHtml = true; SmtpClient client = new SmtpClient("linkskart.com"); client.Credentials = new System.Net.NetworkCredential("*****@*****.**", ".santhu143"); mailmessage.From = new System.Net.Mail.MailAddress("*****@*****.**"); // mailmessage.From = new MailAddress("*****@*****.**"); mailmessage.To.Add(dt_contact.Rows[0]["CONTACT_EMAIL"].ToString()); // mailmessage.CC.Add(emailid); mailmessage.Subject = "your account is created"; mailmessage.Body = "<p> Dear " + dt_contact.Rows[0]["CONTACT_EMAIL"].ToString() + " " + ",<br /> <br />Your account is successfully created " + " please <a href=\"http://www.linkskart.com\">Click Here</a> to visit LINKSKART.</p></div>"; client.EnableSsl = false; try { client.Send(mailmessage); //SmtpMail.Send(eMail); } catch (Exception ae) { // Label1.Text = ae.Message; } } catch (Exception ex) { } }
internal static DataTable CONTACT_EMAIL(CONTACTUS obj) { DataTable dt = BLL.ExecuteQuery("EXEC USP_CONTACTUS @CONTACT_EMAIL='" + obj.CONTACT_EMAIL + "',@OPERATION='CONTACT_EMAIL''"); return dt; }
internal static bool INSERTCONTACT(CONTACTUS obj) { bool status = false; status = BLL.ExecuteNonQuery("EXEC USP_CONTACTUS @CONTACT_NAME='" + obj.CONTACT_NAME + "',@CONTACT_EMAIL='" + obj.CONTACT_EMAIL + "',@CONTACT_SUBJECT='" + obj.CONTACT_SUBJECT + "',@CONTACT_PHONENUMBER='" + obj.CONTACT_PHONENUMBER + "',@CONTACT_MESSAGE='" + obj.CONTACT_MESSAGE + "',@CONTACT_CREATEDBY=1,@CONTACT_MODIFIEDBY=1,@OPERATION='INSERTCONTACT'"); return status; }