我存储我的mailsettings在web配置是这样的...
<mailSettings>
<smtp from="splidge@findremovalcompanies.com">
<network host="smtp.findremovalcompanies.com" userName="splidge@findremovalcompanies.com" password="password" />
</smtp>
</mailSettings>
现在,当我创建一个新的
var smtp = new SmtpClient();
SMPT有我的凭据,将默认的地址splidge@findremovalcompanies.com从而节省了我不必每次都这样做。
MailAddress("splidge@findremovalcompanies.com", "Splidge Master")
但我无法弄清楚如何在web.config孤单指定友好的显示名称“Splidge大师”它没有设置?