using System.Net;
using System.Net.Mail;
using System.Net.Mime;
private void button1_Click(object sender, EventArgs e)
{
SmtpClient Smtp = new SmtpClient("smtp.gmail.com", 587);
Smtp.Credentials = new NetworkCredential("yourmail@gmail.com", "password");
Smtp.EnableSsl = true;
MailMessage Message = new MailMessage();
Message.From = new MailAddress("yourmail@gmail.com", "Sender Name", Encoding.UTF8);
Message.To.Add(new MailAddress("abc@abc.com"));
Message.Subject = "New Message";
Message.SubjectEncoding = Encoding.UTF8;
Message.Body = "Message text\n123\n456\n789";
Smtp.Send(Message);
}
The result:
Message text
123
456
789