.NET Mail Setting
来源:互联网 发布:vslam 算法 编辑:程序博客网 时间:2024/05/13 13:51
首先需要在Web.config中设置这些信息:
<system.net> <mailSettings> <smtp deliveryMethod="Network" from="BTS@hengtiansoft.com"> <network host="mail.hengtiansoft.com" port="587" userName="BTS" password="password"/> </smtp> </mailSettings> </system.net>
然后在调用的.cs文件中:
static Configuration config = WebConfigurationManager.OpenWebConfiguration("~/"); static MailSettingsSectionGroup settings = (MailSettingsSectionGroup)config.GetSectionGroup("system.net/mailSettings"); private static string systemID = settings.Smtp.Network.UserName; private static string systemPassword = settings.Smtp.Network.Password; private static string SMTPHost = settings.Smtp.Network.Host; private static int SMTPPort = settings.Smtp.Network.Port;
记得添加一些必要的引用。
0 0
- .NET Mail Setting
- vmware net setting
- my.setting vb.net
- .NET发送Mail介绍
- Freamwork2.0 net.mail
- System.Net.Mail 简介
- Mail-POP3(LumiSoft.Net)
- .net send Mail
- C# System.Net.Mail
- System.Net.Mail
- .Net.Mail,学习
- .net mail發送
- .net mail 发送
- Send Mail with Asp.net
- System.Net.Mail发邮件
- vb .net 发送mail(JMAIL)
- System.Net.Mail 例子 [收藏]
- System.Net.Mail 详细讲解
- 3Sum
- 黑马程序员_集合类2
- 关于extern const
- SLQServer 中的字符加密 函数HASHBYTES的使用
- IRST在ssd上建立休眠分区,开机12秒不是梦
- .NET Mail Setting
- sql:1999语法和集合运算
- Hbase文档阅读
- 黑马程序员_集合类
- poj 1284 Primitive Roots(数论:欧拉函数)
- 成为究极程序员的艰难的六步
- Hadoop配置文件
- linux grep命令
- POJ 3264-Balanced Lineup(线段树:单点更新,区间查询)