Guest User

Untitled

a guest
May 27th, 2018
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Net.Mail;
  6. using System.Net;
  7.  
  8. namespace ConsoleApplication2
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14. var client = new SmtpClient("smtp.gmail.com", 587)
  15. {
  16. Credentials = new NetworkCredential("myusername@gmail.com", "mypwd"),
  17. EnableSsl = true
  18. };
  19. client.Send("myusername@gmail.com", "myusername@gmail.com", "test", "testbody");
  20. Console.WriteLine("Sent");
  21. Console.ReadLine();
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment