【发布时间】:2020-04-24 07:42:34
【问题描述】:
我正在尝试使用 gmail 电子邮件发送多封电子邮件。
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com");
mail.From = new MailAddress("gmail email ssl server");
mail.To.Add("email to send to");
mail.Subject = "Test Mail 2.0";
mail.IsBodyHtml = true;
mail.Body = body;
SmtpServer.Port = 587;
SmtpServer.Credentials = new System.Net.NetworkCredential("email@email.com", "My Password");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
它运行良好,但如您所知,C# 代码是可检索的。您知道 gmail 将接受作为密码的加密方法吗? 所以我可以在代码中存储,只有加密的密码,我的电子邮件仍然容易受到攻击,但比现在少很多。
【问题讨论】:
标签: c# gmail networkcredentials