【发布时间】:2010-05-04 17:21:11
【问题描述】:
我注意到我们总是这样:
SmtpClient mSmtpClient = new SmtpClient();
// Send the mail message
mSmtpClient.Send(mMailMessage);
设置凭据的唯一位置是在 web.config 中:
<system.net>
<mailSettings>
<smtp>
<network host="xxx.xx.xxx.229" userName="xxxxxxxx" password="xxxxxxxx"/>
</smtp>
</mailSettings>
</system.net>
所以我的问题是,它是如何自动将它们取出来的?
【问题讨论】:
标签: c# asp.net web-config smtpclient