This is about some calling methods of the SMS interface, asp, two methods, calling the SMS interface is relatively simple, but also more practical. Writing method one:
Copy the code code as follows:
<%
Sub sendsms(mobile,msg)
'If you need to send multiple mobile phone numbers, please cycle automatically. Use "," to separate multiple mobile phone numbers. Do not add "," after the last mobile phone number.
'Or call our HttpInterfaceMore.aspx interface, followed by the same parameters or call our webservers interface
dim userid,password,username,sms,status
dimxmlObj,httpsendurl
'Please add your account password
sms=platform
username=username
userid = enterprise ID
password = password
Please contact us to request a free test account
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 'Sent successfully
Response.Write <br><br>Return status code: &status& Sending status: Sent successfully! <a
href=javascript:history.back();>Return to sending page</a>
Else 'Failed to send
Response.Write <br><br>Return status code: &status& Sending status: Sending failed! <a
href=javascript:history.back();>Return to sending page</a>
End if
End sub
%>
Writing method two
Copy the code code as follows:
<%
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
'Represents successful sending
If msg=1 then
SendSms=OK
else
sendSms=ERR
endIF
End Function
%>