我有此代码可以在我的页面中发送电子邮件通知。
MailAddress to = new MailAddress("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="abd3d3d3d3d3ebccc6cac2c785c8c4c6" rel="noreferrer noopener nofollow">[email protected]</a>");
MailAddress from = new MailAddress("<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="38404040785f55595154165b5755" rel="noreferrer noopener nofollow">[email protected]</a>");
MailMessage message = new MailMessage(from, to);
message.Subject = "Error Occred in the application:";
message.Body = ex.Message;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
client.EnableSsl = true;
client.Credentials = new NetworkCredential("user", "password");
我们是否有其他方法无需提供凭据即可发送消息?
最佳答案
提到了一些解决方法 here
关于asp.net - 有没有办法使用 ASP.NET 发送电子邮件通知而不使用凭据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4000418/