using (MailMessage mm = new MailMessage("from@gmail.com", "to@gmail.com"))
{
mm.Subject = "Subject Text";
mm.Body = "Body Text";
mm.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential("from@gmail.com", "pwm");
ServicePointManager.ServerCertificateValidationCallback
=
delegate(object s, X509Certificate certificate,
X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
smtp.UseDefaultCredentials = false;
smtp.Credentials = NetworkCred;
smtp.DeliveryMethod =
System.Net.Mail.SmtpDeliveryMethod.Network;
smtp.Port = 587;
smtp.Send(mm);
//ClientScript.RegisterStartupScript(GetType(),
"alert", "alert('Email sent.');", true);
}
Awesome post....great job bro....
ReplyDeleteIt has been a great help there. Such codes are really time saving in many occasions. Thank you for sharing the script. Keep posting!
ReplyDeleteBest Regards,
Crish Watson
Pass Microsoft Certification Without Taking Exam
offensivesecurityusa.com prepares you for an increasingly critical field: information security. Our courses focus on real-world penetration testing techniques and methods, preparing you to tackle real-life challenges. Our certifications prove to employers that you have the in-demand skills they need.
ReplyDeleteHow to get OSED without exam.
pass OSWE certification without training
pass OSEP certificate without test
pass OSWP certificate without exam
pass OSCE certificate without exam
pass OSCP certificate without taking exam
pass ccnp certification without exam
ReplyDeletepass ccie enterprise infrastructure certification online
nclex certification without exam in usa
cisa certification without exam online
cism certification without exam online
cgeit certification without exam
crisc certification without exam