You are here:
ActiveXperts.com > SMS and MMS Toolkit > How to Use the SMS and MMS Toolkit > HTTP/SMS > 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="objHttpProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:0F81C972-915E-41C7-B881-667FD2629300"></object> <object id="objSmsMessage" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:6900ABDD-A93C-430F-9939-A0477D4D6F4E" ></object> <object id="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:D59B5767-F7FA-47B7-A1D3-816934964EC4" ></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 HTTP POST object:
var objHttp; objHttpProtocol = new ActiveXObject ( "ActiveXperts.SmsProtocolHttp" );or
<object id="objHttpProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:0F81C972-915E-41C7-B881-667FD2629300"></object>
Insert the following lines to declare and create the SmsMessage object:
var objSmsMessage; objSmsMessage = new ActiveXObject ( "ActiveXperts.SmsMessage" );or
<object id="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:6900ABDD-A93C-430F-9939-A0477D4D6F4E"></object>
Insert the following lines to declare and create the SmsConstants object:
var objSmsConstants; objSmsConstants = new ActiveXObject ( "ActiveXperts.SmsConstants" );or
<object id="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:D59B5767-F7FA-47B7-A1D3-816934964EC4"></object>
You can now send SMS messages.
The following HTML code shows how to send a SMS through an HTTP POST based SMS Service:
<html>
<head>
<title>ActiveXperts SMS and MMS Toolkit HTML Sample</title>
<META HTTP-EQUIV="CONTENT-Type" CONTENT="text/html;CHARSET=utf-8" >
<object id="objHttpProtocol" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:0F81C972-915E-41C7-B881-667FD2629300"></object>
<object id="objSmsMessage" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:6900ABDD-A93C-430F-9939-A0477D4D6F4E"></object>
<object id="objSmsConstants" codeBase="http://www.activexperts.com/files/xmstoolkit/axmsctrl.dll" classid="CLSID:D59B5767-F7FA-47B7-A1D3-816934964EC4"></object>
<script language="JavaScript">
function Send ()
{
// Provider Settings
objHttpProtocol.ProviderHost = "post.activexperts-labs.com";
objHttpProtocol.ProviderPort = 8080;
objHttpProtocol.ProviderErrorResponse = "ERR"; // Response should NOT contain 'ERR'
objHttpProtocol.ProviderSuccessResponse = "id"; // Response should contain 'id'
// URL Templates
objHttpProtocol.URLText = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%";
objHttpProtocol.URLBinary = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%&data=1";
objHttpProtocol.URLUnicode = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%&unicode=1";
// SMS Message Properties
objSmsMessage.Data = "ActiveXperts SMS and MMS Toolkit HTTP/SMS Demo";
objSmsMessage.Sender = "+31638740160";
if ( checkUnicode.value == "on" )
{
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_UNICODE;
}
else
{
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_TEXT;
}
objHttpProtocol.Send( objSmsMessage );
if ( objHttpProtocol.LastError == 0 )
{
textResult.value = "SUCCESS";
}
else
{
textResult.value = "ERROR " + objHttpProtocol.LastError + " : " + objHttpProtocol.GetErrorDescription ( objHttpProtocol.LastError );
}
textResponse.value = objHttpProtocol.ProviderResponse;
}
</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 HTTP POST capable SMS provider.</b>
<br>
<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>
<td valign="top">Sender:</td>
<td>
<input size="50" type="text" name="textSender" value="<enter sender 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> </td>
<td>
<input type="checkbox" name="checkUnicode">Send message as Unicode</input>
</td>
</tr>
<tr>
<td valign="top">Result:</td>
<td>
<input size="50" type="text" name="textResult"></input>
</td>
</tr>
<tr>
<td valign="top">Response</td>
<td>
<input size="50" type="text" name="textResponse"></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.