from:Dilip <evasola.com@gmail.com>
to:Evasola <evasola.com@gmail.com> date:Fri, Aug 5, 2016 at 11:05 PM
subject:Website Contact usmailed-by:gmail.comsigned-by:gmail.comencryption:Standard (TLS) Learn more
:Important mainly because of the people in the conversation.
MailMessage mm = new MailMessage();
mm.From = new MailAddress(txtemail.Text, txtname.Text);
mm.To.Add(new MailAddress("dilipkrsharma1990@gmail.com", "dilip sharma"));
// mm.To.Add("arnold@visa-consultant.com");
mm.Bcc.Add("dilipkrsharma1990@gmail.com");
mm.Subject = "Website Contact us ";
string Body = "Full Name: " + txtname.Text + "<br /><br />Email-Id: " + txtemail.Text + "<br /><br />Contact No.: " + txtphone.Text + "<br /><br />Message: " + txtmsg.Text + "<br /><br />Message Date and Time: " + System.DateTime.Now.ToLongDateString() + " " + System.DateTime.Now.ToLongTimeString();
mm.Body = Body;
mm.IsBodyHtml = true;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
System.Net.NetworkCredential NetworkCred = new System.Net.NetworkCredential();
NetworkCred.UserName = "evasola.com@gmail.com";
NetworkCred.Password = "XXX";
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
ServicePointManager.ServerCertificateValidationCallback =
delegate(object s, X509Certificate certificate,
X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtp.Port = 587;
smtp.Send(mm);