您的位置:首页 > 编程语言 > ASP

云片短信平台ASP版程序网站使用方法

2017-10-23 20:56 246 查看

云片短信平台ASP版程序使用方法:

<%

@LANGUAGE="VBSCRIPT" CODEPAGE="65001"

response.contenttype = "text/html;charset=utf-8"

method = "POST"

mobile = Server.URLEncode("xxxxxxxxxxx") '您要发送的手机号

apikey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" '修改为您的apikey(https://www.yunpian.com)登录官网后获取

text ="【云片网】您的验证码是1234" '发送内容

url_send_sms   = "https://sms.yunpian.com/v2/sms/single_send.json"

data_send_sms  =  "apikey=" & apikey & "&mobile=" & mobile & "&text=" & text

response.write GetBody(url_send_sms,data_send_sms)

Function GetBody(url,data)

    Set https = Server.CreateObject("MSXML2.ServerXMLHTTP")

    With https

    .Open method, url, False

    .setRequestHeader "Content-Type","application/x-www-form-urlencoded"

    .Send data

   

    GetBody= .ResponseBody

    End With

    GetBody = bytetostr(https.ResponseBody,"utf-8")

    Set https = Nothing

End Function

function bytetostr(vin,cset)

dim bs,sr

set bs = server.createObject("adodb.stream")

    bs.type = 2

    bs.open

    bs.writetext vin

    bs.position = 0

    bs.charset = cset

    bs.position = 2

    sr = bs.readtext

    bs.close

set bs = nothing

bytetostr = sr

end function
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐