/// <summary> /// 发送短信 /// </summary> /// <param name="receivers">消息接收者</param> /// <param name="message">消息内容</param> /// <returns></returns> public override bool SendMessage(string receivers, string message) { var request = new ChuangLanRequest { Mobile = receivers, Content = message }; try { IMessageSender messageSender = new ChuangLanMessageSender(request); messageSender.Send(); } catch (Exception ex) { throw ex; } return(true); }
/// <summary> /// 发送通知短信 /// </summary> /// <param name="channel"></param> private void SendMessage(jmp_interface channel) { //TODO:发送短信提示 var request = new ChuangLanRequest { Mobile = ConfigReader.GetSettingValueByKey("CHUANGLAN.MOBILE.MONITOR"), Content = string.Format(ConfigReader.GetSettingValueByKey("CHUANGLAN.CONTENT.MONITOR"), channel.l_corporatename, channel.l_id) }; try { IMessageSender messageSender = new ChuangLanMessageSender(request); messageSender.Send(); } catch (Exception ex) { AddLocLog.AddLog(1, 4, Request.UserHostAddress, "通道状态检测", ex.ToString()); } }
public override bool Send() { //TODO:发送短信提示 var request = new ChuangLanRequest { Mobile = ConfigReader.GetSettingValueByKey("CHUANGLAN.MOBILE.MONITOR"), Content = ConfigReader.GetSettingValueByKey("CHUANGLAN.CONTENT.MONITOR") }; try { IMessageSender messageSender = new ChuangLanMessageSender(request); var success = messageSender.Send(); } catch (Exception ex) { //AddLocLog.AddLog(1, 4, Request.UserHostAddress, "通道状态检测", ex.ToString()); } return(true); }