using System; using System.Net.Mail; namespace Send_Mail { class Program { static void Main() { //Set variables accordingly string receiver_Mail = "receiver@example.com", sender_Mail = "sender@gmail.com", sender_Password = "123"; SmtpClient client = new SmtpClient("smtp.gmail.com", 587); client.EnableSsl = true; client.Credentials = new System.Net.NetworkCredential(sender_Mail, sender_Password); client.Send(sender_Mail, receiver_Mail, "subject", "body"); // Set the subject and body of your email Console.ReadLine(); } } }