asp.net - 在 ASP.NET 应用程序中将 SmtpClient.UseDefaultCredentials 设置为 true 时将使用哪个用户?

标签 asp.net asp.net-mvc-3 smtpclient

在 ASP.NET 或 ASP.NET MVC 应用程序中,如果我使用 SmtpClient 发送电子邮件与 UseDefaultCredentials设置为true,哪个用户将用于向邮件服务器进行身份验证?

最佳答案

如果UseDefaultCredentials属性设置为 trueSmtpClient将使用提供给 DefaultCredentials属性(property)在 CredentialCache类。

来自MSDN :

For ASP.NET applications, the default credentials are the user credentials of the logged-in user, or the user being impersonated.

关于asp.net - 在 ASP.NET 应用程序中将 SmtpClient.UseDefaultCredentials 设置为 true 时将使用哪个用户?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16681686/

相关文章:

asp.net-mvc - 将 CSS 类添加到 DataAnnotations MVC 3 中的字段

c# - 通过 Gmail SMTP 发送电子邮件时如何在 FROM 字段中使用任何电子邮件地址?

c# - SmtpFailedRecipientException 和 SmtpFailedRecipientsException

带有 '#' 或 '=' 的 ASP.NET 尖括号。有什么不同?

c# - “必须有”.NET 组件 : experienced developers?

asp.net-mvc-3 - 在 HttpPost 上将嵌套模型与 MVC3 绑定(bind)

c# - SmtpClient 可扩展性问题(仅运行两个请求)

c# - MVC View 脚手架不适用于通用基类?

javascript - 如何在单击 Asp.Net 按钮单击事件时显示弹出窗口

asp.net - 为什么在 ASP.Net 中向 StatusDescription 添加换行符会关闭连接?