示例#1
0
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="Address">收件人地址</param>
 /// <param name="Subject">主题</param>
 /// <param name="Body">内容</param>
 public SmtpHelper(string Address, string Subject, string Body)
 {
     this.Address  = Address;
     this.Subject  = Subject;
     this.Body     = Body;
     this.sendinfo = SmtpSendInfo.GetInfoFromConfig();
 }
示例#2
0
 /// <summary>
 /// 获取配置文件中的发件人信息
 /// </summary>
 /// <returns></returns>
 public static SmtpSendInfo GetInfoFromConfig()
 {
     SmtpSendInfo info = new SmtpSendInfo();
     info.UserName = ConfigValue.Get("SmtpEmail");
     info.Passwrod = ConfigValue.Get("SmtpPwd");
     info.Host = ConfigValue.Get("SmtpHost");
     info.Port = Convert.ToInt32(ConfigValue.Get("SmtpPort"));
     return info;
 }
示例#3
0
        /// <summary>
        /// 获取配置文件中的发件人信息
        /// </summary>
        /// <returns></returns>
        public static SmtpSendInfo GetInfoFromConfig()
        {
            SmtpSendInfo info = new SmtpSendInfo();

            info.UserName = ConfigValue.Get("SmtpEmail");
            info.Passwrod = ConfigValue.Get("SmtpPwd");
            info.Host     = ConfigValue.Get("SmtpHost");
            info.Port     = Convert.ToInt32(ConfigValue.Get("SmtpPort"));
            return(info);
        }