using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Net.Mail; using System.Net; /// /// Summary description for SendEmail /// public class SendEmail { public SendEmail() { //ContactPerson, CompanyName, Address, EmailID, MobileNumbe, Fax, Subject // TODO: Add constructor logic here // } public bool GetEmailData(string ArrivalDate,string NoofPerson,string YourName,string YourEmailAddress,string YourPhoneNumber,string FaxNo,string StreetAddress,string CityState,string ZipPostalCode,string country,string RequirementsSuggestion) { bool chk = false; ////if (!(cname == null || cname == "" || cphoneno == null || cphoneno == "" || cemail == null || cemail == "" || cPlan == null || cPlan == "")) ////{ try { SmtpClient smtp = new SmtpClient(); MailMessage msg = new MailMessage(); string mess = "
"; mess += "

Client Information


Arrival Date : " + ArrivalDate + "
No of Person : " + NoofPerson + "
Your Name : " + YourName + "
Your Email Address : " + YourEmailAddress + "
Your Phone Number : " + YourPhoneNumber + "
Fax No : " + FaxNo + "
Street Address : " + StreetAddress + "
City/State : " + CityState + "
Zip/Postal Code : " + ZipPostalCode + "
country : " + country + "
Requirements Suggestion : " + RequirementsSuggestion; mess += "
"; System.Net.Mail.AlternateView plainview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(System.Text.RegularExpressions.Regex.Replace(mess, @"<(.|\n) *?>", string.Empty), null, "text/plain"); System.Net.Mail.AlternateView htmlview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(mess, null, "text/html"); msg.AlternateViews.Add(plainview); msg.AlternateViews.Add(htmlview); msg.IsBodyHtml = true; msg.From = new MailAddress("noreplay@shrichardham.com"); msg.To.Add("shritravelsandtours@gmail.com"); msg.To.Add("shreshtha@shrichardham.com"); msg.Subject = "Contact Information"; msg.Body = mess; smtp.Host = "shrichardham.com";//"smtpout.secureserver.net"; smtp.EnableSsl = false; //smtp.Credentials = new System.Net.NetworkCredential("info@allindiawebinfotech.com", "zxcv1234"); smtp.Credentials = new System.Net.NetworkCredential("noreplay@shrichardham.com", "zxcv1234"); smtp.Send(msg); chk = true; } catch (Exception ex) { chk = false; } if (chk == true) { return true; } else { return false; } } public bool GetEmailData1(string Name,string Email,string Date,string NoOfPerson,string PhoneNo,string Country,string Requirements) { bool chk = false; ////if (!(cname == null || cname == "" || cphoneno == null || cphoneno == "" || cemail == null || cemail == "" || cPlan == null || cPlan == "")) ////{ try { SmtpClient smtp = new SmtpClient(); MailMessage msg = new MailMessage(); string mess = "
"; mess += "

Client Information


Full Name : " + Name + "
Email Id : " + Email + "
Date : " + Date + "
No Of Person : " + NoOfPerson + "
Phone Number : " + PhoneNo + "
Country : " + Country + "
Requirements /Suggestion : " + Requirements; mess += "
"; System.Net.Mail.AlternateView plainview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(System.Text.RegularExpressions.Regex.Replace(mess, @"<(.|\n) *?>", string.Empty), null, "text/plain"); System.Net.Mail.AlternateView htmlview = System.Net.Mail.AlternateView.CreateAlternateViewFromString(mess, null, "text/html"); msg.AlternateViews.Add(plainview); msg.AlternateViews.Add(htmlview); msg.IsBodyHtml = true; msg.From = new MailAddress("noreplay@shrichardham.com"); msg.To.Add("shritravelsandtours@gmail.com"); msg.To.Add("shreshtha@shrichardham.com"); msg.Subject = "Contact Information"; msg.Body = mess; smtp.Host = "shrichardham.com";//"smtpout.secureserver.net"; smtp.EnableSsl = false; smtp.Credentials = new System.Net.NetworkCredential("noreplay@shrichardham.com", "zxcv1234"); smtp.Send(msg); chk = true; } catch (Exception ex) { chk = false; } if (chk == true) { return true; } else { return false; } } }