public static int SendSMS(string src, string dest, string msgbody) { try { if (listPhone.Contains(dest)) { string requestid = DateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(0, 999999).ToString("000000"); GatewaySoapClient client = new GatewaySoapClient(); return(client.SendMT(src, dest, msgbody, requestid, USER_NAME, PASSWORD)); } return(-202); } catch (Exception ex) { logger.Error(ex); return(-101); } }
public static int SendSMS(string phone, string content) { try { string requestid = DateTime.Now.ToString("yyyyMMddHHmmss") + new Random().Next(0, 999999).ToString("000000"); GatewaySoapClient client = new GatewaySoapClient(); int result = client.SendMT("VietinBank", phone, content, requestid, username, password); client.Close(); // 0 success return((int)result); } catch (Exception ex) { log.Error(ex); return(-100); } }