using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.IO; using System.Drawing; using System.Net; using System.Net.Mail; public partial class contactus : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { if (TextBox1.Text == "" || TextBox2.Text == "" || TextBox3.Text == "" || TextBox4.Text == "") { string strscript = ""; Page.RegisterStartupScript("popup", strscript); } else { string emailto = "divinesurgicalworld@gmail.com"; // Client Email Id Where Email Want to Go string company = "Divine Surgical World"; // Company Name //Enquiry Form Details string name = TextBox1.Text; // Name From Enquiry Form string mobile =TextBox2.Text; // Mobile Number From Enquiry Form string email = TextBox3.Text; // Email iD from Enquiry From string msg = TextBox4.Text; // Message From Enquiry Form string strUrl = "http://api.thankyoubuyers.com/Default.aspx?company="+company+"&name="+name+"&mobile="+mobile+"&email="+email+"&msg="+msg+"&to="+emailto; System.Net.WebRequest request = System.Net.WebRequest.Create(strUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream s1 = (Stream)response.GetResponseStream(); StreamReader readStream = new StreamReader(s1); string dataString = readStream.ReadToEnd(); response.Close(); s1.Close(); readStream.Close(); string strscript = ""; Page.RegisterStartupScript("popup", strscript); TextBox4.Text = ""; TextBox3.Text = ""; TextBox2.Text = ""; TextBox1.Text = ""; } } }