zoukankan      html  css  js  c++  java
  • gmail

    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. namespace smtp_client
    8. {
    9. class Program
    10. {
    11. static void Main (string[] args)
    12. {
    13. MailAddress myemail = new MailAddress("me@gmail.com", "Name");
    14. MailAddress mail_to = new MailAddress("receiver@yahoo.com", "Receiver");
    15. string password = "email_password";
    16. SmtpClient Client_smtp = new SmtpClient("smtp.gmail.com", 587);
    17. client_smtp.EnableSsl = true;
    18. client_smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
    19. client_smtp.UseDefaultCredentials = false;
    20. client_smtp.Credentials = new NetworkCredential (myemail.Address, password);
    21. MailMessage message = new MailMessage (myemail, mail_to);
    22. message.Subject = "Hello from sharpcode";
    23. message.Body = "just a test";
    24. client_smtp.Send(message);
    25. }
    26. }
    27. }
  • 相关阅读:
    POJ 2136
    POJ 2121
    POJ 2127
    POJ 2126
    POJ 2109
    POJ 2105
    POJ 2101
    POJ 2075
    Uboot — 配置过程
    Uboot — 编译体验
  • 原文地址:https://www.cnblogs.com/zeroone/p/3378773.html
Copyright © 2011-2022 走看看