using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class contact_us : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void contmail()
    {
        try
        {
            MailMessage Msg = new MailMessage();
            Msg.From = new MailAddress("contact@doorjet.in", "Booking Details");
            Msg.To.Add("homeappliancesservicecenter71@gmail.com");
            Msg.Subject = "Contact Us Form Details";
            StringBuilder sb = new StringBuilder();
            sb.Append("Name :" + txtname.Text + "\r\n");
            sb.Append("phone:" + txtphone.Text + "\r\n");
            sb.Append("Subject:" + txtsubject.Text + "\r\n");
            sb.Append("Message :" + txtMessage.Text + "\r\n");
            Msg.Body = sb.ToString();
            SmtpClient smtp = new SmtpClient();
            smtp.Host = "doorjet.in";
            smtp.Port = 25;
            smtp.Credentials = new System.Net.NetworkCredential("contact@doorjet.in", "doorjet@!1231");
            smtp.EnableSsl = false;
            smtp.Send(Msg);

            Response.Write("<Script>alert('Thanks for contact us,our team will be contact you as soon as possible')</Script>");

        }
        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        contmail();

    }
}