Using the SMS and MMS Toolkit with PHP

The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality. SMS messages can be sent using a GSM/GPRS modem, an SMPP provider, an HTTP compliant SMS provider or using a standard dialup or fixed-line SMS modem. MMS messages can be sent via a GSM/GPRS modem (MM1), an SMTP server (MM4) or an XML/SOAP compliant provider (MM7).

SMS features:

  • Send and receive numeric- and alphanumeric text SMS messages
  • Verify delivery of outgoing SMS messages
  • Support for multimedia SMS messages, including ringtones, pictures and logo's
  • Support for WAP Push, WAP Bookmarks, vCards, voicemail/e-mail/fax/MMS indications
  • Support for Unicode, to support foreign languages like Arabic, Chinese, Hebrew, etc.
  • Support for multi-part messages, to allow messages longer than 160 characters
  • Support for GSM modems, GSM phones, SMS/HTTP providers, SMPP (Short Message Peer to Peer) providers, TAP/XIO and UCP dial-in SMSC providers
  • Support Multi-threading environments. The component is thread-safe, which means it can be used in a multi-threaded environment
  • Samples included for various development platforms: MS Visual Basic, MS Visual Basic .NET, MS Visual C++, MS Visual Studio C# .NET, ASP, ASP .NET, Borland Delphi, Borland C++ Builder, Windows Powershell ColdFusion and more

MMS features:

  • Support for many multimedia formats incl.: JPG, GIF, PNG, BMP, WBMP, TIF, WAV, MP3, MIDI, AC3, GP3, AVI, MPG, MP4, VCARD, VCALENDAR, JAR and more
  • Support for MM1 (MMS over WAP), MM4 (MMS over SMTP) and MM7 (MMS over HTML/SOAP)

Pager features:

  • Send alpha-numeric Pager messages through SNPP

This document describes how the SMS and MMS Toolkit can be integrated into PHP projects.

Step 1: Installation of the SMS and MMS Toolkit

On each client PC, download the SMS and MMS Toolkit from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.

Step 2: Create the SMS objects in PHP

You must use the following code to declare the COM object(s) in PHP:

Use the following PHP code to declare and create the GSM objects:

$objGsmProtocol = new COM ( "ActiveXperts.SmsProtocolGsm" );

Insert the following line to declare and create the SmsMessage object:

$objSmsMessage = new COM ( "ActiveXperts.SmsMessage" );

Insert the following line to declare and create the SmsConstants object:

$objSmsConstants = new COM ( "ActiveXperts.SmsConstants" );

Step 3: Send and/or receive SMS messages

You can now send and/or receive SMS messages.

The following PHP code shows how to send a SMS through a connected GSM phone or modem:

   <META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
   <title>ActiveXperts SMS and MMS Toolkit HTML Sample</title>
   <font face="sans-serif" size="2">
   <hr size="1" color="#707070">
   <font size="4">ActiveXperts SMS and MMS Toolkit PHP Sample</font>
   <b>Send an SMS message to a recipient through an SMPP connection.</b>
   <hr size="1" color="#707070">

   $objGsmProtocol = new COM ( "ActiveXperts.SmsProtocolGsm" );
   $objSmsMessage  = new COM ( "ActiveXperts.SmsMessage" );
   $objGsmProtocol->Device    = "COM1";

   $objSmsMessage->Recipient = "+31647134225";
   $objSmsMessage->Data      = "Hello World, SMS Message From PHP";
   $objGsmProtocol->Send( objSmsMessage );
   if ( $objGsmProtocol->LastError == 0 )
       Echo "Message successfully submitted.";
       $ErrorNum = $objGsmProtocol->LastError;
       $ErrorDes = $objGsmProtocol->GetErrorDescription ( $ErrorNum );

       Echo "Error sending message: #$ErrorNum ($ErrorDes).";

   <hr size="1" color="#707070">
   <font size="1" face="Verdana">This demo uses the ActiveXperts SMS and MMS Toolkit, an <a href="">ActiveXperts Software</a> product.</font>

There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: