Call us: +45 50 322 322

Sample code – HTTP(s) – Classic ASP

The following Sample code shows, how to send make an integration in Delphi with HTTPs:

<html>
<!– SMS test.html
– Made by Glen Mandsberg 2015. Copy as much as you like
–>
<head>
<title>I am sending a SMS message</title>
</head>
<body>
</body>
</html>
<script language=”vbscript”>
<%username= “+4540818824″password = “12345”
tophonenumberwithcountrycode = “+4540818824″
fromMax11char = “Santa”
theMessage = “Hello world! I can send special chars like æ ø and å”
pathtouse = “https://api.suresms.com/script/SendSMS.aspx?
login=”&username&”&password=”&password&”&to=”&tophonenumberwithcountrycode&”&from=”&fromMax11char&”&Text=”+server.urlencode(theMessage)

Set objXMLHTTP = Server.CreateObject(“Microsoft.XMLHTTP”)
objXMLHTTP.open “post”, pathtouse, False, “”, “”
objxmlhttp.setRequestHeader “Content-Type”, “text/plain;charset=UTF-8″
objXMLHTTP.send

XMLOutput = HTMLDecode(objXMLHTTP.responseText)
Statuscode = int(objXMLHTTP.status)
responsetext = objXMLHTTP.ResponseText
Set objXMLHTTP = Nothing

%>
</script>

It is nessasary to change the parametres, so that they do match the username and Password, you recieved when opening your SureSMS account!

In case you need to use any special characters e.g. the danish letters "Æ,Ø and Å" it is important, that you save the ASP-file in UTF-8 .

If the danish characters still do not work, try changing the endpoint to one of these:

SendSMS_UTF8.aspx
SendSMS_UTF7.aspx or
SendSMS_Unicode.aspx

in stead.

Should you have any questions, you are allways welcome to send an E-mail to support@suresms.com. We are looking forward to helping you.

Need an account?

Do you still need an account or a free test account? Follow this link and we will make you one in 5 minuts.