ASP SMS interface source is relatively simple but also very practical use (two) _ Application techniques

Source: Internet
Author: User
Tags urlencode
Writing a:
Copy Code code as follows:

<%
Sub sendsms (mobile,msg)
If you need to send multiple mobile phone number, please automatically cycle, multiple mobile phone number between "," separated, the last mobile phone number does not add, number
' or call our Httpinterfacemore.aspx interface, followed by parameters, or call our Webservers interface
Dim userid,password,username,sms,status
Dim Xmlobj,httpsendurl
' Please add your account password
Sms= "Platform"
Username= "User Name"
UserID = "Enterprise ID"
Password = "Password"
Please contact us to obtain 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& Send status: Send success! <a
Href= "" Javascript:history.back (); "" > Back to send Page </a> "
Else ' send failed
Response.Write "<br><br> Return Status code:" &status& Send status: Send failed! <a
Href= "" Javascript:history.back (); "" > Back to send Page </a> "
End If
End Sub
%>

Writing two
Copy 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
is sent successfully
If msg= "1" then
sendsms= "OK"
Else
sendsms= "ERR "
End IF
End Function
%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.