MailMessage mail = new MailMessage(); mail.Subject = "Subject"; mail.Body = "Main body goes here"; mail.From = new System.Net.Mail.MailAddress("my_email@gmail.com","My Name"); mail.IsBodyHtml = false; mail.BodyEncoding = System.Text.Encoding.Unicode; mail.SubjectEncoding = System.Text.Encoding.Unicode; mail.To.Add("mailto@yahoo.com"); NetworkCredential cred = new NetworkCredential( "mail_using_send@gmail.com", //from email address of the sending account "password"); //password of the sending account SmtpClient smtp = new SmtpClient("smtp.gmail.com"); smtp.UseDefaultCredentials = false; smtp.EnableSsl = true; smtp.Credentials = cred; smtp.Port = 587; smtp.Send(mail);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)