using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Net.Mail; public partial class contact : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void SendMail(object sender, EventArgs e) { if (!IsValid) { return; } else { MailMessage mail = new MailMessage(); mail.From = new MailAddress("info@travnet.co.in"); mail.To.Add("info@travnet.co.in"); mail.Subject = "Enquiry for Hotel Priya Palace, Guwahati (travnet.co.in)"; mail.IsBodyHtml = true; mail.Body = "CLIENT PROFILE" + "
"; mail.Body += "First Name: " + FNameTB.Text + "
"; mail.Body += "Last Name: " + LNameTB.Text + "
"; mail.Body += "Email: " + EmailTB.Text + "
"; mail.Body += "Contact No.: " + Tel.Text + "
"; mail.Body += "Country: " + Country.SelectedItem.Text + "
" + "
"; mail.Body += "CLIENT'S REQUIREMENT" + "
"; mail.Body += "Hotel Name: " + Hname.Value + "
"; mail.Body += "Check In : " + InDate.SelectedItem.Text + "/" + InMonth.SelectedItem.Text + "/" + InYear.SelectedItem.Text + "
"; mail.Body += "Check Out : " + OutDate.SelectedItem.Text + "/" + OutMonth.SelectedItem.Text + "/" + OutYear.SelectedItem.Text + "
"; mail.Body += "Room Category: " + Room.SelectedItem.Text + "
"; mail.Body += "No. Of Rooms: " + NoRooms.Text + "
"; mail.Body += "No. Of Pax: " + Adults.SelectedItem.Text + " Adults " + Child.SelectedItem.Text + " Kids " + "
" + "
"; mail.Body += "Newsletter Subscription: " + NWLT.SelectedItem.Text + "
" + "
"; mail.Body += "Transport/Other Details: " + CommentsTB.Text + "
"; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.net4india.com"; smtp.Send(mail); formPH.Visible = false; sucessPH.Visible = true; } } protected void Reset(object s, EventArgs e) { FNameTB.Text = ""; LNameTB.Text = ""; Tel.Text = ""; EmailTB.Text = ""; CommentsTB.Text = ""; NoRooms.Text = ""; } }