using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Security;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data;
using System.Xml.Linq;
using System.Configuration;
using System.Text;
using System.Net.Mail;
using System.Globalization;
using System.Net;

public partial class samsung_fridge_repair : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {

            // city();


        }
    }

    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 = "Booking Details";
            StringBuilder sb = new StringBuilder();
            sb.Append("Name :" + txtname.Text + "\r\n");
            sb.Append("Mobile Number:" + txtnumber.Text + "\r\n");
            sb.Append("City :" + txtcity.Text + "\r\n");

            sb.Append("Service :" + "fridge Repair" + "\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);



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




    protected void clear()
    {
        txtname.Text = "";
        txtcity.Text = "";
        txtnumber.Text = "";

    }
    protected void Button1_Click(object sender, EventArgs e)
    {

        contmail();
        clear();
        Response.Redirect("booking-successful");
    }
}