/// <summary> /// 更新客服列表 /// </summary> public void RefreshServiceList() { string _serviceids = ""; string _servicenames = ""; string _servicemails = ""; using (DbOperHandler _doh = new Common().Doh()) { _doh.Reset(); _doh.SqlCmd = "SELECT [ServiceId],[ServiceName],[Email] FROM [jcms_normal_user] WHERE ServiceId>0"; DataTable dt = _doh.GetDataTable(); for (int j = 0; j < dt.Rows.Count; j++) { if (j == 0) { _serviceids = dt.Rows[j]["ServiceId"].ToString(); _servicenames = dt.Rows[j]["ServiceName"].ToString(); _servicemails = dt.Rows[j]["Email"].ToString(); } else { _serviceids += "," + dt.Rows[j]["ServiceId"].ToString(); _servicenames += "," + dt.Rows[j]["ServiceName"].ToString(); _servicemails += "," + dt.Rows[j]["Email"].ToString(); } } string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/message.config"); JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile); XmlTool.Update("Messages/Service/UserId", _serviceids); XmlTool.Update("Messages/Service/UserName", _servicenames); XmlTool.Update("Messages/Service/UserMail", _servicemails); XmlTool.Save(); XmlTool.Dispose(); } }
/// <summary> /// 系统发邮件给客服 /// </summary> /// <param name="_Title"></param> /// <param name="_Body"></param> /// <returns></returns> public bool SendServiceMail(string _Title, string _Body) { string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/message.config"); JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile); string _ServiceMail = XmlTool.GetText("Messages/Service/UserMail"); XmlTool.Dispose(); return(SendMail(_ServiceMail, _Title, _Body)); }
public bool SendMail(string _To, string _Title, string _Body) { string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/mail.config"); JumboECMS.DBUtility.XmlControl XmlTool = new JumboECMS.DBUtility.XmlControl(strXmlFile); string _MailFrom = XmlTool.GetText("Mails/System/Address"); string _MailFromName = XmlTool.GetText("Mails/System/NickName"); string _MailPwd = XmlTool.GetText("Mails/System/Password"); string _MailSmtpHost = XmlTool.GetText("Mails/System/SmtpHost"); XmlTool.Dispose(); _Body += "<br /><br />" + site.Name1 + " <a href='" + site.Url + "'>" + site.Url + "</a>"; return(JumboECMS.Common.MailHelp.SendOK(_To, _Title, _Body, true, _MailFrom, _MailFromName, _MailPwd, _MailSmtpHost)); }