Shortcut Menu

Skip

Main Navigation

Choose your language

You are here:

ActiveXperts.com > SMS and MMS Toolkit > Objects > SmsProtocolHttp

ActiveXperts SMS and MMS Toolkit Add SMS and MMS capabilities to any Windows or .NET application

SMS and MMS Toolkit - SmsProtocolHttp object

Overview

With the easy-to-use SMS/HTTP interface you can send SMS messages directly from your business applications or websites in minutes. All you need is a subscription with a commercial HTTP-compliant SMS provider, and an internet connection.

You can send different types of SMS messages through HTTP:

  • Text - Plain text (default);
  • Unicode - Unicode message;
  • Data - Binary data.

The SmsProtocolHttp object features the following:

  • Send SMS messages by connecting to an HTTP-POST compliant service provider throguh the internet (or VPN);
  • Support for text and binary data;
  • Send WAP Push messages and WAP Bookmark messages;
  • Support for Unicode, to support foreign languages like Chinese, Turkish, etc.;
  • Support for proxy servers and secure web sites;
  • Support password protected web sites.

The SmsProtocolHttp object is part of the ActiveXperts SMS and MMS Toolkit component. Overview of all SMS and MMS Toolkit objects:

  • SmsProtocolGsm - Send and receive SMS messages using a GSM modem or a modem-capable GSM phone.
  • SmsProtocolSmpp - Send and receive SMS messages via an SMPP provider.
  • SmsProtocolHttp - Send (bulk) SMS messages through an SMS/HTTP compliant SMS provider over the internet/VPN.
  • SmsProtocolDialup - Send SMS messages using a normal Hayes compatible modem (1200 bps or higher).
  • MmsProtocolMM1 - Send and receive MMS messages via a GPRS modem through WAP (wireless application protocol).
  • MmsProtocolMM4 - Send MMS messages via an SMTP server. The protocol is based on SMTP, messages are MIME encoded.
  • MmsProtocolMM7 - Send and receive MMS messages via SOAP/XML using HTTP as the transport protocol.
  • PagerProtocolSnpp - Send pager messages via an SNPP provider through the internet/VPN.

Sample code

VBScript sample: Send a simple SMS message via HTTP

Set objHttpProtocol            = CreateObject( "ActiveXperts.SmsProtocolHttp" )
Set objSmsMessage              = CreateObject( "ActiveXperts.SmsMessage" )

' Provider Settings
objHttpProtocol.ProviderHost   = "post.activexperts-labs.com" ' Specify host
objHttpProtocol.ProviderPort   = 8080                     ' Specify port (default port:80)
  
' Provider Response templates
objHttpProtocol.ProviderErrorResponse = "ERR"             ' Response should NOT contain 'ERR'
objHttpProtocol.ProviderSuccessResponse = "id"            ' Response should contain 'id'

' URL Template to submit plain text SMS messages
objHttpProtocol.URLText        = "/sendsms/default.asp?username=AX008&password=812056&text=" & _
                                 "%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%"   
objSmsMessage.Clear
objSmsMessage.Recipient        = "+31624896641"           ' Recipient's mobile number
objSmsMessage.Data             = "Hello, world!"          ' SMS message text
objSmsMessage.Sender           = "+31638740160"           ' Message sender   

objHttpProtocol.Send( objSmsMessage )                     ' Send the message   
WScript.Echo "Send, result:" & objHttpProtocol.LastError  ' Display the result  
WScript.Echo "Provider response:" & objHttpProtocol.ProviderResponse  ' Show provider response

VB .NET sample: Send a simple SMS message via HTTP-POST

Imports AXmsCtrl

Module Module1
 Sub Main()

  Dim objHttpProtocol As SmsProtocolHttp = New SmsProtocolHttp
  Dim objSmsMessage As SmsMessage = New SmsMessage


  ' Provider Settings
  objHttpProtocol.ProviderHost = "post.activexperts-labs.com" ' Specify host
  objHttpProtocol.ProviderPort = 8080                       ' Specify port (default port:80)

  ' Provider Response templates
  objHttpProtocol.ProviderErrorResponse       = "ERR"       ' Response should NOT contain 'ERR'
  objHttpProtocol.ProviderSuccessResponse     = "id"        ' Response should contain 'id'

  ' URL Template to submit plain text SMS messages
  objHttpProtocol.URLText      = "/sendsms/default.asp?username=AX008&password=812056&text=" & _
                           "%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%"   

  objSmsMessage.Data           = "ActiveXperts SMS and MMS Toolkit HTTP-Post test message!"
  objSmsMessage.Sender         = "+31625044454"
  objSmsMessage.Recipient      = "+31624896641"

  objHttpProtocol.Send( objSmsMessage )                     ' Send the message   
  Console.WriteLine("Send, result: {0} ( {1} )", 
          objHttpProtocol.LastError.ToString, 
          objHttpProtocol.GetErrorDescription(objHttpProtocol.LastError) )
 End Sub
End Module

More samples

Samples are available for: Visual Basic, Visual C/C++, VB .NET, VC# .NET, ASP, ASP .NET, Borland C++ Builder, Boland Delphi, ColdFusion, Java, Javascript, PHP, HTML and more. On ftp.activexperts-labs.com, you can find many SMS and MMS Toolkit samples. Samples are also part of the SMS and MMS Toolkit installation.