protected void SendMailToAdmin()
{
using (MailMessage mm = new MailMessage())
{
//change it only
............................................................................................................................................................
string sClientMessage = "";
sClientMessage += @"<table border =""0"" width =""100%"" cellspacing =""0"" cellpadding =""0"" >";
sClientMessage += @"<tbody>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""background-color:#eeeeee;""align =""center"" bgcolor =""#eeeeee"" >";
sClientMessage += @"<table class=""mobile-table"" border=""0"" width=""600"" cellspacing=""0"" cellpadding=""0"" align=""center"">";
sClientMessage += @"<tbody>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-size:0; padding:5px;"" align=""center"" valign=""top"" bgcolor=""#204e98"">";
sClientMessage += @"<table style =""width:100%; margin-left:auto; margin-right:auto;"" width=""379"">";
sClientMessage += @"<tbody>";
sClientMessage += @"<tr>";
...................................................................................................................................................................
sClientMessage += @"<td style =""width:50%;"">";
sClientMessage += @"<h1> </h1>";
sClientMessage += @"</td>";
sClientMessage += @"<td style = ""width: 50%;"" >";
sClientMessage += @"<h1 style= ""font-size:36px; font-weight:800; margin:0px; color:#ffffff; text-align:right; background-color:#204e98;""><img src=""http://kishkindawaterpark.com/images/klogo.png""></h1>";
sClientMessage += @"</td >";
sClientMessage += @"</tr >";
sClientMessage += @"</tbody >";
sClientMessage += @"</table >";
sClientMessage += @"</td >";
sClientMessage += @"</tr >";
sClientMessage += @"<tr >";
...............................................................................................................................................................................................................................
sClientMessage += @"<td style=""padding:35px 35px 20px 35px; background-color:#ffffff;"" align=""center"" bgcolor=""#ffffff"">";
sClientMessage += @"<table style =""height:323px;"" border=""0"" width=""527"" cellspacing=""0"" cellpadding=""0"" align=""center"" >";
sClientMessage += @"<tbody >";
sClientMessage += @"<tr >";
sClientMessage += @"<td style =""font-family:Open Sans,Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:24px;padding-top:10px;"" align=""left"" >";
sClientMessage += @"<p style = ""font-size: 16px;font-weight:400;line-height:24px;color: #777777;"" ><span style=""color:#333333;""> Dear Admin ,</span></p>";
sClientMessage += @"<p><span style =""color: #333333; font-weight:600; font-size:18px;""> Welcome to the http://kishkindawaterpark.com/ family!</span></p>";
sClientMessage += @"</td>";
sClientMessage += @"</tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td>";
...............................................................................................................................................................................................................................
sClientMessage += @"<table border =""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">";
sClientMessage += @"<tbody>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;"" align=""left"" bgcolor=""#eeeeee"" width=""75%""><span>Below is Booking Details of " + Name;
sClientMessage += @"</span></td><td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;"" align=""left"" bgcolor=""#eeeeee"" width=""25%""> </td>";
sClientMessage += @"</tr>";
.....................................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>TransactionId:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + TransactionId;
sClientMessage += @"</td></tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Package Name:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + PackageName;
sClientMessage += @"</td></tr>";
....................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Package Type:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + PackageType;
sClientMessage += @"</td></tr>";
..........................................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Name:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Name;
sClientMessage += @"</td></tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Email:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Email;
sClientMessage += @"</td></tr>";
................................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Mobile:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Mobile;
sClientMessage += @"</td></tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>No Of Adult:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Adult;
sClientMessage += @"</td></tr>";
........................................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>No Of Child:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Child;
sClientMessage += @"</td></tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Total Amount:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + Amount;
sClientMessage += @"</td></tr>";
................................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""75%""><span>Travel Date:</span></td>";
sClientMessage += @"<td style =""font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;"" align=""left"" width=""25%"">" + TravelDate;
sClientMessage += @"</td></tr>";
...................................................................................................................
sClientMessage += @"</tr>";
sClientMessage += @"</tbody>";
sClientMessage += @"</table>";
sClientMessage += @"</td>";
sClientMessage += @"</tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""padding-top: 20px;"" align=""left""></td>";
sClientMessage += @"</tr>";
sClientMessage += @"</tbody>";
sClientMessage += @"</table>";
sClientMessage += @"</td>";
sClientMessage += @"</tr>";
.................................................................................................................
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""padding:35px; background-color:#ffffff;"" align=""center"" bgcolor=""#ffffff"">";
sClientMessage += @"<table border = ""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" align=""center"">";
sClientMessage += @"<tbody>";
sClientMessage += @"<tr>";
sClientMessage += @"<td align =""center""><img style=""display:block;border:0px;"" src=""http://kishkindawaterpark.com/images/klogo.png""></td>";
sClientMessage += @"</tr>";
sClientMessage += @"<tr>";
sClientMessage += @"<td style =""font-family:Open Sans, Helvetica,Arial, sans-serif; font-size:14px; font-weight:400; line-height:24px; padding:5px 0 10px 0;"" align=""center"">";
sClientMessage += @"<p style =""font-size: 12px; font-weight: 600; line-height: 18px; color: #333333;""> Support: Email: kishkindawaterpark@gmail.com Phone: +91-08533287036</p>";
sClientMessage += @"</td>";
...........................................................................................................
sClientMessage += @"</tr>";
sClientMessage += @"</tbody>";
sClientMessage += @"</table>";
sClientMessage += @"</td>";
sClientMessage += @"</tr>";
sClientMessage += @"</tbody>";
sClientMessage += @"</table>";
..............................................................................................................................
//sClientMessage = "<table width=\"600px\" cellspacing=\"1\" cellpadding=\"2\" style=\"font-family:arial; font-size:12px;\">";
//sClientMessage += "<tr><td colspan=\"3\">Hi, <br /><br /> Mr./Mrs. " + txtName.Text + " Send Enquiry:<br /><br /></td></tr>";
//sClientMessage += "<tr><td align=\"left\" width=\"50%\" style=\"background-color: #C1D2FF; padding-left:10px;\">Name:</td> <td align=\"left\" style=\"background-color: #9DB8FF; padding-left:10px;\">" + txtName.Text + "</td></tr>";
//sClientMessage += "<tr><td align=\"left\" width=\"50%\" style=\"background-color: #C1D2FF; padding-left:10px;\">Email:</td> <td align=\"left\" style=\"background-color: #9DB8FF; padding-left:10px;\">" + txtEmail.Text + "</td></tr>";
//sClientMessage += "<tr><td align=\"left\" width=\"50%\" style=\"background-color: #C1D2FF; padding-left:10px;\">Mobile:</td> <td align=\"left\" style=\"background-color: #9DB8FF; padding-left:10px;\">" + txtContact.Text + "</td></tr>";
//sClientMessage += "<tr><td align=\"left\" width=\"50%\" style=\"background-color: #C1D2FF; padding-left:10px;\">Message:</td> <td align=\"left\" style=\"background-color: #9DB8FF; padding-left:10px;\">" + txtMessage.Text + "</td></tr>";
//sClientMessage += "</table>";
//change it only
...........................................................................................................
mm.From = new MailAddress("example@gmail.com"); //--- Email address of the sender
....................................................................................
mm.To.Add("example@gmail.com"); //---- Email address of the recipient.
.............................................................
mm.Subject = "Welcome to the website url Family!" + (Name); //---- Subject of email.
........................................................................
mm.Body = sClientMessage; //---- Content of email.
............................................................................
mm.IsBodyHtml = true; //---- To specify wether email body contains HTML tags or not.
..........................................................................................
SmtpClient smtp = new SmtpClient();
....................................................
smtp.Host = "smtp.gmail.com"; //---- SMTP Host Details.
.....................................................................
smtp.EnableSsl = true; //---- Specify whether host accepts SSL Connections or not.
..................................................................................................
NetworkCredential NetworkCred = new NetworkCredential("Example@gmail.com", "password");
......................................................................................................
//---Your Email and password
smtp.UseDefaultCredentials = true;
....................................................
smtp.Credentials = NetworkCred;
...............................................................
smtp.Port = 587; //---- SMTP Server port number. This varies from host to host.
..........................................
smtp.Send(mm);
.....................................................................
//ltrlMsg.Text = "Congratulations, Your email successfully sent";
//txtName.Text = "";
//txtEmail.Text = "";
//txtContact.Text = "";
//txtMessage.Text = "";
}
}
No comments:
Post a Comment