<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
注册用户名
user = Server.URLEncode("user")
key = "接口鉴权KEY"
'接收手机号码,多个号码提交如:13812345678,13812345679,13812345670
mobile = "13812345678"
'发送短信的内容,签名前置:【珑云】验证码:8888
content = "验证码:8888"
url = "http://api.smslong.cn"
post = "user="& user &"&key="& key &"&mobile="& mobile &"&content="& content
HttpState = PostHttpPage(url,post,"utf-8")
'HttpState=短信发送提交后的状态回执
'建议把$mobile,$content,$HttpState值写入数据库
Response.Write HttpState '打印输出短信发送状态回执
Function PostHttpPage(PostUrl, PostData, Coding)
On Error Resume Next
Dim xmlHttp
Set xmlHttp = server.createobject("MSXML2.XMLHTTP")
xmlHttp.Open "post", PostUrl, False
xmlHttp.setRequestHeader "Content-Length", Len(PostData)
xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlHttp.Send PostData
If Err Then
Set xmlHttp = Nothing
PostHttpPage = "$False$"
Exit Function
End If
PostHttpPage = BytesToBstr(xmlHttp.ResponseBody, Coding)
Set xmlHttp = Nothing
End Function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
%>