Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement