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

时间:2013-05-22 00:34:59

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

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

1 个答案:

答案 0 :(得分:3)

如果UseDefaultCredentials属性设置为true,则SmtpClient将使用提供给 DefaultCredentials类中的CredentialCache属性。

来自MSDN

  

对于ASP.NET应用程序,默认凭据是登录用户的用户凭据或被模拟的用户