public void SendMail(string from, string pwd ,string to) { try { SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; smtp.Port = 587; smtp.EnableSsl = true; smtp.DeliveryMethod = SmtpDeliveryMethod.Network; smtp.Credentials = new System.Net.NetworkCredential(from, pwd); MailMessage Msg = new MailMessage(from, to, "Demo Mail", txtStfComments.Text); Msg.IsBodyHtml = false; smtp.Send(Msg); } catch (Exception ex) { throw ex; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)