Using SMS and MMS Toolkit in an HTML form (MM1 Connection)
The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality.
An 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.
An 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 Chinese, Turkisch, 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, 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 HTML projects.
Step 1: Installation of the SMS and MMS Toolkit
When using HTML, there are two ways to install the SMS and MMS Toolkit on a client PC:
Automatically using HTML code;
Using the SMS and MMS Toolkit InstallShield installation.
Automatic installation using HTML code
You can install the SMS and MMS Toolkit automatically using the following HTML code on top of the HTML page:
The MMS Toolkit will be installated automatically. The user will be asked to confirm the installation, because the DLL is coming from an untrusted site (www.activexperts.com).
There are two ways to avoid prompting:
Add the ActiveX/COM location to the user's trusted sites. You can manage trusted manually (by using the Internet Explorer), through a logon script (by appyling the registry change from the logon script) or by using Active Directory Group Policies;
OR use a trusted location for the DLL. For instance your Intranet site, because most probably this site has already been added to the list of trusted sites for all users.
Digitally sign the AXmsCtrl.cab file and load it from your own website.
Manual installation using the SMS and MMS Toolkit installation procedure
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 MMS objects in HTML/JavaScript
You must use Javascript to declare and create the objects.
Use the following Javascript code to declare and create the MMS objects:
var objMmsProtocolMm1;
var objMmsMessage;
var objMmsSlide;
var objMmsConstants;
objMmsProtocolMm1 = new ActiveXObject ( "ActiveXperts.MmsProtocolMm1" );
objMmsMessage = new ActiveXObject ( "ActiveXperts.MmsMessage" );
objMmsSlide = new ActiveXObject ( "ActiveXperts.MmsSlide" );
objMmsConstants = new ActiveXObject ( "ActiveXperts.MmsConstants" );
Step 3: Send MMS messages
You can now send MMS messages.
The following HTML code shows how to send a MMS:
<html>
<head>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<head>
<object codebase="http://www.activexperts.com/files/axmstool/axmsctrl.cab"
classid="CLSID:054BA820-49CB-4C93-9128-F26BB73C226E" >
</head>
<title>ActiveXperts SMS and MMS Toolkit HTML/JavaScript Sample</title>
<script language="JavaScript">
function Send ()
{
var objMmsProtocolMm1 = new ActiveXObject ( "ActiveXperts.MmsProtocolMm1" );
var objMmsMessage = new ActiveXObject ( "ActiveXperts.MmsMessage" );
objMmsProtocolMm1.Device = comboDevice.options [ comboDevice.selectedIndex].text;
objMmsProtocolMm1.Logfile = "C:\\MmsLogHttp.txt";
objMmsProtocolMm1.ProviderAPN = "mms";
objMmsProtocolMm1.ProviderAPNAccount = "";
objMmsProtocolMm1.ProviderAPNPassword = "";
objMmsProtocolMm1.ProviderMMSC = "http://mms.orange.nl:8002/";
objMmsProtocolMm1.ProviderWAPGateway = "10.250.255.183";
objMmsMessage.AddRecipient ( textRecipient.value );
objMmsMessage.Subject = textSubject.value;
var objMmsSlide = new ActiveXObject ( "ActiveXperts.MmsSlide" );
objMmsSlide.AddText ( textMessage.value );
objMmsSlide.AddAttachment ( textAttachment.value );
objMmsMessage.AddSlide ( objMmsSlide );
objMmsProtocolMm1.Connect ();
if ( objMmsProtocolMm1.LastError != 0 )
{
textResult.value = "CONNECT: ERROR " + objMmsProtocolMm1.LastError + " : "
+ objMmsProtocolMm1.GetErrorDescription ( objMmsProtocolMm1.LastError );
return;
}
objMmsProtocolMm1.Send ( objMmsMessage );
textResult.value = "SEND: ERROR " + objMmsProtocolMm1.LastError + " : "
+ objMmsProtocolMm1.GetErrorDescription ( objMmsProtocolMm1.LastError );
objMmsProtocolMm1.Disconnect ();
}
function ListDevices ()
{
var objMmsProtocolMm1 = new ActiveXObject ( "ActiveXperts.MmsProtocolMm1" );
nCount = objMmsProtocolMm1.GetDeviceCount ();
for ( i = 0 ; i < nCount ; i++ )
{
comboDevice.options [ i ] = new Option ( objMmsProtocolMm1.GetDevice ( i ), "" );
}
}
</script>
</head>
<body onload="ListDevices()">
<font face="verdana" size="2">
<hr size="1" color="#707070">
<b><font size="4">ActiveXperts SMS and MMS Toolkit HTML/JavaScript Sample</font></b>
<br>
<br>
Send an MMS message to a recipient through a GSM/GPRS Phone or Modem connected to your PC.
<br>
<br>
</b>
<br>
<hr size="1" color="#707070">
<br>
<table border="0" bgcolor="#f0f0f0" >
<tr>
<td width="120" valign="top">Device Name:</td>
<td width="450">
<select size="1" id="comboDevice" ></select>
</td>
</tr>
<tr>
<td valign="top">Recipient:</td>
<td>
<input size="50" type="text" id="textRecipient" value="<enter recipient number>" ><br>
</td>
<tr>
</tr>
<tr>
<td valign="top">Subject:</td>
<td>
<input size="50" type="text" id="textSubject" >
</td>
</tr>
<tr>
<td valign="top">Message:</td>
<td>
<textarea rows="3" id="textMessage" cols="38" >Hello, world</textarea>
</td>
</tr>
<tr>
<td valign="top">Attachment:</td>
<td>
<input size="50" type="file" id="textAttachment" >
</td>
</tr>
<tr>
<td vAlign="top">Result:</td>
<td>
<input size="50" id="textResult" ></input>
</td>
</tr>
</table>
<br>
<input type="button" onclick="Send()" value="Send Message">
<br>
<br>
<b>IMPORTANT:</b> Please press the button <b>only once</b>, and allow some time for the MMS to be processed.
</form>
</font>
<br>
<hr size="1" color="#707070">
</body>