好记性不如烂笔头。

.NET获取web.config电子邮件配置

 
Configuration config = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(System.Web.HttpContext.Current.Request.ApplicationPath);
SmtpSection smtp = (SmtpSection)config.GetSection("system.net/mailSettings/smtp");