You are here:
ActiveXperts.com > SMS and MMS Toolkit > How to Use the SMS and MMS Toolkit > SMPP Provider > 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="objSmppProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:0B3C73A0-D209-465A-B6C4-9B6AC9DCC424" viewastext></object>
<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="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.
Insert the following lines to declare and create the Smpp object:
var objSmppProtocol; objSmppProtocol = new ActiveXObject ( "ActiveXperts.SmsProtocolSmpp" );
Insert the following lines to declare and create the SmsMessage object:
var objSmsMessage; objSmsMessage = new ActiveXObject ( "ActiveXperts.SmsMessage" );
Insert the following lines 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 through an SMPP provider:
<html>
<head>
<title>ActiveXperts SMS and MMS Toolkit HTML Sample</title>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<object id="objSmppProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:0B3C73A0-D209-465A-B6C4-9B6AC9DCC424" viewastext></object>
<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="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" height="30" width="200"
classid="CLSID:D59B5767-F7FA-47B7-A1D3-816934964EC4" viewastext></object>
<script language="JavaScript">
function Send ()
{
objSmppProtocol.Server = "smpp.activexperts-labs.com";
objSmppProtocol.ServerPort = 2775;
objSmppProtocol.SystemID = "ax004";
objSmppProtocol.SystemPassword = "812056";
objSmppProtocol.SystemType = "SMPP";
objSmppProtocol.Logfile = "c:\\HttpSmppLog.txt";
objSmppProtocol.ServerTimeout = 5000;
objSmppProtocol.SystemMode = objSmsConstants.asSMPPMODE_TRANSMITTER;
objSmsMessage.Recipient = textRecipient.value;
objSmsMessage.Data = textMessage.value;
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_TEXT;
if ( checkUnicode.value == "on" )
{
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_UNICODE;
}
objSmppProtocol.Connect ();
if ( objSmppProtocol.IsConnected != 0 )
{
objSmppProtocol.Send( objSmsMessage );
objSmppProtocol.Disconnect ();
}
if ( objSmppProtocol.LastError == 0 )
{
textResult.value = "SUCCESS";
}
else
{
textResult.value = "ERROR " + objSmppProtocol.LastError + " : " + objSmppProtocol.GetErrorDescription ( objSmppProtocol.LastError );
}
}
</script>
</head>
<body>
<font face="sans-serif" size="2">
<hr size="1" color="#707070">
<font size="4">ActiveXperts SMS and MMS Toolkit HTML Sample</font>
<br>
<br>
<b>Send an SMS message to a recipient through an SMPP connection.</b>
<br>
<br>
<hr size="1" color="#707070">
<br>
<table border="0" bgcolor="#f0f0f0" ID="Table1">
<tr>
<td valign="top">Recipient:</td>
<td>
<input size="50" type="text" name="textRecipient" value="<enter recipient number>"><br>
</td>
</tr>
<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" type="text" name="textResult"></input>
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="checkbox" name="checkUnicode">Send message as Unicode</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 SMS to be processed.
</form>
<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.