protected void SendMail() { // Gmail Address from where you send the mail var fromAddress = "rajeshkumar.pani@gmail.com"; // any address where the email will be sending var toAddress = "dsssweta@gmail.com"; //Password of your gmail address const string fromPassword = "1234"; // Passing the values and make a email formate to display string subject = "Hi"; string body = "From: "; // smtp settings var smtp = new System.Net.Mail.SmtpClient(); { smtp.Host = "localhost"; smtp.Port = 25; smtp.EnableSsl = true; smtp.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network; smtp.Credentials = new NetworkCredential(fromAddress, fromPassword); // smtp.Timeout = 20000; } // Passing values to smtp object smtp.Send(fromAddress, toAddress, subject, body); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)