2012年1月26日 星期四

asp.net sent GMAIL email C#


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發信測試""文件內容");

沒有留言:

張貼留言