You are here:
ActiveXperts.com > SMS and MMS Toolkit > How to Use the SMS and MMS Toolkit > GSM phone or modem > HTML
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 HTML projects.
When using HTML, there are two ways to install the SMS and MMS Toolkit on a client PC:
You can install the SMS and MMS Toolkit automatically using the following HTML code on top of the HTML page:
<head>
<object id="objSmsMessage" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:6900ABDD-A93C-430F-9939-A0477D4D6F4E" viewastext></object>
<object id="objGsmProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:30F256C0-EE6E-4C57-A475-E3E81236119F" viewastext></object>
<object id="objSmppProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:0F81C972-915E-41C7-B881-667FD2629300" viewastext></object>
<object id="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:D59B5767-F7FA-47B7-A1D3-816934964EC4" viewastext></object>
</head>
The SMS and 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:
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.
You must use Javascript to declare and create the objects.
Use the following Javascript code to declare and create the GSM object:
var objGsmProtocol; objGsmProtocol = new ActiveXObject ( "ActiveXperts.SmsProtocolGsm" );
Insert the following line to declare and create the SmsMessage object:
var objSmsMessage; objSmsMessage = new ActiveXObject ( "ActiveXperts.SmsMessage" );
Insert the following line to declare and create the SmsConstants object:
var objSmsConstants; objSmsConstants = new ActiveXObject ( "ActiveXperts.SmsConstants" );
You can now send and/or receive SMS messages.
The following HTML code shows how to send a SMS using a connected GSM phone or modem:
<html>
<head>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<title>ActiveXperts SMS and MMS Toolkit HTML Sample</title>
</head>
<body onload="ListDevices()">
<script language="JavaScript">
var objGsmProtocol;
var objSmsMessage;
var objSmsConstants;
function Send ()
{
objGsmProtocol.Logfile = "c:\\SmsLogHttp.txt";
objGsmProtocol.Device = comboDevice.options [ comboDevice.selectedIndex].text
objSmsMessage.Recipient = textRecipient.value;
objSmsMessage.Data = textMessage.value;
if ( checkUnicode.value == "on" )
{
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_UNICODE;
}
else
{
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_TEXT;
}
objGsmProtocol.Send( objSmsMessage );
textResult.value = "ERROR " + objGsmProtocol.LastError + " : " + objGsmProtocol.GetErrorDescription ( objGsmProtocol.LastError );
}
function ListDevices ()
{
objGsmProtocol = new ActiveXObject ( "ActiveXperts.SmsProtocolGsm" );
nCount = objGsmProtocol.GetDeviceCount ();
for ( i = 0 ; i < nCount ; i++ )
{
comboDevice.options [ i ] = new Option ( objGsmProtocol.GetDevice ( i ), "" );
}
for ( i = 1 ; i < 9 ; i++ )
{
comboDevice.options [ i + nCount - 1 ] = new Option ( "COM" + i , "" );
}
}
</script>
<font face="verdana" size="2">
<hr size="1" color="#707070">
<b><font size="4">ActiveXperts SMS and MMS Toolkit HTML Sample</font></b>
<br>
<br>
Send an SMS message to a recipient through a GSM Phone or Modem connected to your PC.
<br>
</b>
<br>
<hr size="1" color="#707070">
<br>
<table border="0" bgcolor="#f0f0f0" ID="Table1">
<tr>
<td width="120" valign="top">Device Name:</td>
<td width="450">
<select size="1" name="comboDevice" ></select>
</td>
</tr>
<tr>
<td valign="top">Recipient:</td>
<td>
<input size="50" type="text" name="textRecipient" value="<enter recipient number>" ><br>
<font size="1" face="verdana"><b><font color="#700000">IMPORTANT</font>
</b>: Use a country code prefix. For instance,<br>to send an sms to 07797882390 in the U.K., use +447797882390.
</font>
</td>
<tr>
</tr>
<tr>
<td valign="top">Message:<br>(max. 160 chars)</td>
<td>
<textarea rows="3" name="textMessage" cols="38" >Hello, world</textarea>
</td>
</tr>
<tr>
<td vAlign="top">Result:</td>
<td>
<input size="50" name="textResult" ></input>
</td>
</tr>
<tr>
<td vAlign="top"> </td>
<td>
<input type="checkbox" name="checkUnicode" >Send message as Unicode</input>
</td>
</table>
<br>
<input type="button" onclick="Send()" value="Send Message">
<br>
</form>
</font>
<br>
<hr size="1" color="#707070">
</body>
</html>
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.