var client = new System.Net.Mail.SmtpClient("smtp.gmail.com", 587)
{
EnableSsl = true,
DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network,
UseDefaultCredentials = false,
Credentials = new System.Net.NetworkCredential("XXX帳號XXX@gmail.com", "XX密碼XXX")
};
啟用發信
1.Impt 啟用
2.安全性較低的應用程式存取權限」為「啟用」(預設是「停用」
https://www.google.com/settings/security/lesssecureapps
沒有留言:
張貼留言