Quicklinks
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:
MMS features:
Pager features:
This document describes how the SMS and MMS Toolkit can be integrated into ASP projects.
Download the SMS and MMS Toolkit from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
You must use the following code to declare the COM object(s) in PHP: Use the following PHP code to declare and create the MM7 objects:
$objMm7Protocol = new Com("ActiveXperts.MmsProtocolMm7");
Insert the following line to declare and create the MmsMessage object:
$objMessage = new Com("ActiveXperts.MmsMessage");
Insert the following line to declare and create the MmsSlide object:
$objSlide = new Com("ActiveXperts.MmsSlide");
Insert the following line to declare and create the MmsConstants object:
$objConstants = new Com("ActiveXperts.MmsConstants");
To send an MMS using MM7 you need to have an MM7 provider. The provider properties and the message properties need to be passed to the MMS and SMS Toolkit. Therefore create a form which contains the following fields:
If the com objects described in step 2 are succesfully created you can now send MMS messages using a SOAP compliant MMS provider.
The following PHP code generates a website where the user can fill in a file which must be located on the webserver, and send it as a MMS message to his mobile phone or email address.
The demo can be run from a client connecting to the PHP webserver. The client does not need any additional hardware.
The following PHP code shows how to send a MMS:
$objMm7Protocol = new Com("ActiveXperts.MmsProtocolMm7");
$objMessage = new Com("ActiveXperts.MmsMessage");
$objSlide = new Com("ActiveXperts.MmsSlide");
$objConstants = new Com("ActiveXperts.MmsConstants");
$attachment = "C:\Windows\System32\Setup.bmp";
$numLastError = 0;
$strLastError = "";
$strReply = "";
if( $_POST["CTL_SEND"] != "" ){
$attachment = $_POST["CTL_ATTACHMENT"];
$objSlide->Clear();
$objSlide->AddText( $_POST["CTL_MESSAGE"] );
if( $_POST["CTL_ATTACHMENT"] != "" ) $objSlide->AddAttachment( $_POST["CTL_ATTACHMENT"], 0 );
$objMessage->Clear();
$objMessage->AddRecipient( $_POST["CTL_RECIPIENT"], $objConstants->asMMS_RECIPIENT_TO );
$objMessage->From = $_POST["CTL_SENDER"];
$objMessage->Subject = $_POST["CTL_SUBJECT"];
$objMessage->AddSlide($objSlide);
$objMm7Protocol->Clear();
$objMm7Protocol->ProviderURL = $_POST["CTL_URL"];
$objMm7Protocol->ProviderAccount = $_POST["CTL_ACCOUNT"];
$objMm7Protocol->ProviderPassword = $_POST["CTL_PASSWORD"];
if( $_POST["CTL_SSL"] != "" ){
$objMm7Protocol->ProviderUseSSL = true;
}
$objMm7Protocol->Send( $objMessage );
$numLastError = $objMm7Protocol->LastError;
$strLastError = $objMm7Protocol->GetErrorDescription( $numLastError );
}
There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/mobile-messaging-component.