您的位置:首页 >  接口中心 > 短信接口DEMO-ASP
  短信接口DEMO-ASP
 

<%@language="vbscript" codepage="65001">

<%

response.codepage=65001  

response.charset="utf-8"  

url="https://u.smsyun.cc/sms-partner/access/{用户帐号}/sendsms"

username="{您的账号}" ''请替换您的帐号

password=md5("您的密码")''请替换您的密码


mobile="*******" ''要发送的手机号码,多个请用英文状态下的,逗号间隔

Randomize

code = Int(Rnd * 9000 + 1000)

content="【云信】您的验证码是"&code  ''要发送的内容



data="{""smstype"":""4"",""clientid"":""b05gv1"",""password"":""8a6f2805b4515ac12058e79e66539be1"",""mobile"":"""&mobile&""",""content"":"""&content&""",""sendtime"":"""&now&""",""extend"":""00"",""uid"":""00""}"

set http=Server.createobject("Microsoft.XMLHTTP") 

    Http.open "POST",url,false 

    http.setRequestHeader "Accept-Encoding","identity "

    http.setRequestHeader "Accept","application/json"

    http.setRequestHeader "Content-Length",len(data)

    http.setRequestHeader "Content-Type","application/json; charset=utf-8"

    Http.send(data)

    '获得返回结果

    response.write http.responseText

    'code===0 表示发送成功请自行解析json数据 或返回前台用js解析json数据