MailMessage mail = new MailMessage(); mail.To.Add("ToOther@gmail.com"); mail.From = new MailAddress("testfrom@gmail.com"); mail.Subject = "subj"; mail.Body = "Hi, this mail is to test sending mail using Gmail in ASP.NET"; mail.IsBodyHtml = true; SmtpClient smtp = new SmtpClient(); smtp.Host = "smtp.gmail.com"; //Or Your SMTP Server Address smtp.Credentials = new System.Net.NetworkCredential ("jxxxxx@gmail.com", "Yzzzzzz"); smtp.EnableSsl = true; smtp.Send(mail);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)