System.Net.Mail.SmtpClient MySmtp = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587);
MySmtp.Credentials = new System.Net.NetworkCredential("YourID", "YourPassword");
//Gmial 的 smtp 使用 SSL
MySmtp.EnableSsl = true;
//發送Email
MySmtp.Send("發送者<sender@gmail.com>", "收件者<receiver@gmail.com>", "C# Gmail發信測試", "文件內容");
沒有留言:
張貼留言