您现在的位置是:网站首页> 编程资料编程资料
asp短信接口源码 比较简单但也挺实用用的(两个写法)_应用技巧_
2023-05-25
200人已围观
简介 asp短信接口源码 比较简单但也挺实用用的(两个写法)_应用技巧_
写法一:
<%
Sub sendsms(mobile,msg)
'如需要发送多个手机号,请自动循环,多个手机号之间用“,”分隔,最后手机号码后不加,号
'或调用我们 HttpInterfaceMore.aspx 接口,后跟参数一样或调用我们的webservers接口
dim userid,password,username,sms,status
dim xmlObj,httpsendurl
'请添写您的账号密码
sms="平台"
username="用户名"
userid = "企业ID"
password = "密码"
请联系我们索取免费测试帐号
httpsendurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?
comid="&userid&"&username="&username&"&userpwd="&password&"&handtel="&mobile&"
&sendcontent="&server.URLEncode(msg)&"&sendtime=&smsnumber="&sms
Set xmlObj = server.CreateObject("Microsoft.XMLHTTP")
xmlObj.Open "POST",httpsendurl,false
xmlObj.send()
status = xmlObj.responseText
Set xmlObj = nothing
If status = "1" then '发送成功
Response.Write "
返回状态码:"&status&" 发送状态:发送成功! href=""javascript:history.back();"">返回发送页面"
Else '发送失败
Response.Write "
返回状态码:"&status&" 发送状态:发送失败! href=""javascript:history.back();"">返回发送页面"
End if
End sub
%>
写法二
<%
Function SendSms(UserName, UserPass, DstMobile, SmsMsg)
Dim http,msg,strUrl,RndNumber
set http = Server.CreateObject("Microsoft.XMLHTTP")
strurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=121&username="&SmsName&"&userpwd="&SmsPw&"
&sendtime=&smsnumber=1065&handtel="&DstMobile&"&sendcontent="&server.URLEncode(SmsMsg)
http.Open "GET",strUrl, false
http.setRequestHeader "Content-type:", "text/xml;charset=GB2312"
http.Send
msg=http.ResponseText
set http = nothing
'代表发送成功
If msg="1" then
SendSms="OK"
else
sendSms="ERR"
end IF
End Function
%>
复制代码 代码如下:
<%
Sub sendsms(mobile,msg)
'如需要发送多个手机号,请自动循环,多个手机号之间用“,”分隔,最后手机号码后不加,号
'或调用我们 HttpInterfaceMore.aspx 接口,后跟参数一样或调用我们的webservers接口
dim userid,password,username,sms,status
dim xmlObj,httpsendurl
'请添写您的账号密码
sms="平台"
username="用户名"
userid = "企业ID"
password = "密码"
请联系我们索取免费测试帐号
httpsendurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?
comid="&userid&"&username="&username&"&userpwd="&password&"&handtel="&mobile&"
&sendcontent="&server.URLEncode(msg)&"&sendtime=&smsnumber="&sms
Set xmlObj = server.CreateObject("Microsoft.XMLHTTP")
xmlObj.Open "POST",httpsendurl,false
xmlObj.send()
status = xmlObj.responseText
Set xmlObj = nothing
If status = "1" then '发送成功
Response.Write "
返回状态码:"&status&" 发送状态:发送成功! href=""javascript:history.back();"">返回发送页面"
Else '发送失败
Response.Write "
返回状态码:"&status&" 发送状态:发送失败! href=""javascript:history.back();"">返回发送页面"
End if
End sub
%>
写法二
复制代码 代码如下:
<%
Function SendSms(UserName, UserPass, DstMobile, SmsMsg)
Dim http,msg,strUrl,RndNumber
set http = Server.CreateObject("Microsoft.XMLHTTP")
strurl="http://jiekou.56dxw.com/sms/HttpInterface.aspx?comid=121&username="&SmsName&"&userpwd="&SmsPw&"
&sendtime=&smsnumber=1065&handtel="&DstMobile&"&sendcontent="&server.URLEncode(SmsMsg)
http.Open "GET",strUrl, false
http.setRequestHeader "Content-type:", "text/xml;charset=GB2312"
http.Send
msg=http.ResponseText
set http = nothing
'代表发送成功
If msg="1" then
SendSms="OK"
else
sendSms="ERR"
end IF
End Function
%>
相关内容
- ASP分页时计算页面总数的几种算法小结_应用技巧_
- asp去除html的函数代码分析附实例说明_应用技巧_
- asp 获取参数值与sql安全过滤参数函数代码_应用技巧_
- ASP中Server.Execute和Execute实现动态包含(include)脚本的区别_应用技巧_
- ASP上传漏洞之利用CHR(0)绕过扩展名检测脚本_应用技巧_
- Asp限制IP访问 阻止某一个IP段禁止访问本站的代码_应用技巧_
- 一个改进的ASP生成SQL命令字符串类的代码[已测]_应用技巧_
- asp在服务器把 XML 转换为 XHTML的实现代码_应用技巧_
- asp提示Server 对象 错误 ASP 0178 : 80070005_应用技巧_
- ASP:ActiveX不能创建Scripting.FileSystemObject对象解决办法_应用技巧_
