Exemple #1
0
        /// <summary>
        /// 等于0 发送成功
        /// </summary>
        /// <param name="mobile">手机</param>
        /// <param name="content">内容</param>
        /// <param name="type">1 文字短信(默认) 2 语音</param>
        /// <returns></returns>
        public static decimal Send(string mobile, string content, int type = 1)
        {
            decimal str = 0;

            try
            {
                if (type == 1)
                {
                    //亿美 验证码
                    str = sdkService.sendSMS(yzsn, yzpassword, null, mobile.Split(new char[] { ',' }), content, null, "GBK", 5, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff")));
                }
                if (type == 2)
                {
                    sdkService.sendVoice(yzsn, yzpassword, null, mobile.Split(new char[] { ',' }), content, null, "GBK", 5, Convert.ToInt64(DateTime.Now.ToString("yyyyMMddHHmmssfff")));
                }
            }
            catch (Exception ex)
            {
                LoggerHelper.Error(ex.ToString());
            }
            return(str);
        }