1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using PMS.Plugins.Common;
- using QWPlatform.SystemLibrary.LogManager;
- using System;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using ZlsoftSMS_SdkApi;
- namespace PMS.Plugins.SMS
- {
- public class SendSMS
- {
- /// <summary>
- /// 筷子家医短信
- /// </summary>
- /// <param name="sm"></param>
- /// <param name="msg"></param>
- /// <returns></returns>
- public static bool SendKuaiZiSMS(string phone,ref string code)
- {
- var msg = "";
- var KuaiZiSMSServiceURL = ConfigurationManager.AppSettings["SendingSmsUrl"].ToStringEx();
- var array = KuaiZiSMSServiceURL.Split('|');//【0】WEBAPI请求地址|【1】账号|【2】密码|【3】模板id|【4】签名|【5】所属站点|
- code = HashtableHelper.NewKey();
- SMSRequestClient cc = new SMSRequestClient();
- SystemInternalModel sim = new SystemInternalModel();
- sim.ServerUrl = array[0];
- sim.sms_account = array[1];
- sim.sms_password = array[2];
- sim.template_code = array[3];
- sim.sign_name = array[4];
- sim.phone_numbers = phone;
- sim.paramates = "{\"code\":\"" + code + "\"}";
- sim.siteid = array[5];
- sim.source_mode = "1";
- sim.org_id = "";
- var result = cc.SendSms20200109(sim,out msg);
- Logger.Instance.Info("发送短信(手机号=)"+ phone+"|返回内容=" + result);
- return true;
-
- }
- }
- }
|