|
Advanced Services - SMS Connectivity ASP VBScript Sample application using HTTP to send a UCS2 or Unicode message |
![]() |
The following sample application written in ASP VBScript sends a UCS2 or Unicode message to a single mobile telephone. The application uses HTTP to communicate with HSL's systems. To send to more than one mobile telephone at a time, separate each mobile number in the destaddr field by a comma (e.g. "447968000111,447720000111,3378100100").
<% Option Explicit %>
<html>
<head>
<title>Simple JScript (ASP) example of UCS2 SMS via the HSL HTTP interface</title>
</head>
<body>
<%
' These variables fill out the various parts described in the
' interface specification
Const host = "sms.haysystems.com"
Const port = "80"
Const action = "senducs"
Const client_id = "<your client_id>"
Const ucs2 = "06450631062d0628064b06270020063906270644064500200021"
Const destaddr = "<some fully-qualified MSISDN>"
Const password = "<your secret>"
Dim url
Dim query
Dim xml
Dim result
' Build and encode the URL.
url = "http://" & host & ":" & port & "/" & action & "/"
query = "client_id=" & client_id & "&destaddr=" & destaddr & "&message=" _
& ucs2 & "&password=" & password
' Create instance of the Inet control
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.Open "POST", url, False
xml.Send query
' Make the request and print the result
Response.Write("<p>Submission result: ")
Response.Write(xml.responseText)
Response.Write("</p>")
%>
</body>
</html>
super_simple_ucs2_http_example_vbscript.asp
Copyright © Hay Systems Ltd 2004
Owner: support@haysystems.com 20 September 2004