Download ActiveXperts SMS and MMS Toolkit 5.1  (6826 KB - .exe file)
Download Manual  (623 KB - .htm file)
Using the SMS and MMS Toolkit with ColdFusion / HTTP POST
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 ColdFusion projects.
Step 1: Download and install the SMS and MMS Toolkit
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 a new ColdFusion document
Create a new blank webdocument with the ".cfm" extention.
First of all we are going to build the form whitch commands and properties of the device can be filled in.
Then we are going to make a source code that connects to the device.
Step 3: Implementation
To use HTTP-POST in ColdFusion, we need to use the SmsProtocolHttp and SmsMessage objects for sending SMS messages. We also need the constants object.
<cfobject class="ActiveXperts.SmsProtocolHttp" type="com" name="objHttpProtocol" Action="Create">
<cfobject class="ActiveXperts.SmsMessage" type="com" name="objSmsMessage" Action="Create">
<cfobject class="ActiveXperts.SmsConstants" type="com" name="objConstants" Action="Create">
Step 4: Create a form
To send a SMS message using HTTP the following data is required by the toolkit:
- A url to submit the message to.
- The server port.
- The responses the server might return.
- The message.
- The recipient.
In our default sample there are also fields present for unicode messages. The fields listed above are required fields.
A form which collects this data from the user could look like this:
<cfform method="post">
<table class ="clbody" width="700">
<tr>
<td valign="top" width="170">Host:</td>
<td valign="top" width="530">
<cfinput style="width: 187px" type="text" name="CTL_HOST" value="#strServer#"> :
<cfinput style="width: 50px" type="text" name="CTL_HOSTPORT" value="#strPort#">
</td>
</tr>
<tr>
<td valign="top">URL Template (Text):</td>
<td valign="top"><cfinput style="width: 450px" type="text" name="CTL_URLTEXT" value="#strUrlText#"></td>
</tr>
<tr>
<td valign="top">URL Template (Unicode):</td>
<td valign="top"><cfinput style="width: 450px" type="text" name="CTL_URLUNICODE" value="#strUrlUnicode#"></td>
</tr>
<tr>
<td valign="top">Success Response:</td>
<td valign="top"><cfinput style="width: 250px" type="text" name="CTL_SUCCESSRESPONSE" value="#strSuccessResponse#"></td>
</tr>
<tr>
<td valign="top">Error Response:</td>
<td valign="top"><cfinput style="width: 250px" type="text" name="CTL_ERRORRESPONSE" value="#strErrorResponse#"></td>
</tr>
<tr>
<td valign="top">Sender:</td>
<td valign="top"><cfinput style="width: 250px" type="text" name="CTL_SENDER" value="#strSender#"> (displayed on the recipients phone)</td>
</tr>
<tr>
<td valign="top">Recipient:</td>
<td valign="top"><cfinput style="width: 250px" type="text" name="CTL_RECIPIENT" value="#strRecipient#">
<a target="_blank" href="http://www.activexperts.com/support/xmstoolkit?kb=Q5200015##Q5200015">Recipient number format</a></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td valign="top"><cfinput style="width: 250px" type="text" name="CTL_MESSAGE" value="#strMessage#"></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"><cfinput type="checkbox" name="CTL_UNICODE" value="uni"> Unicode</td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"><cfinput size="25" type="submit" value="Send" name="CTL_SEND" style="height: 23px; width: 250px"></td>
</tr>
<tr>
<td valign="top"> </td>
<td valign="top"> </td>
</tr>
<tr>
<td valign="top">Result code:</td>
<td valign="top">#numLastError#: #strLastError#</td>
</tr>
</tr>
<td valign="top">Last Response:</td>
<td valign="top">#strLastResponse#</td>
</tr>
</table>
</cfform>
Step 5: Collect the submitted data and send the message.
If the form is submitted and the data is succesfully collected, the message needs to be sent to the recipient.
The Message object and the HttpPost object need to be configured to send a message.
The message object contains all message data like the message type, the message body and the recipient number.
The url, the port, the errorresponse and so on are stored in the HttpPost object.
If all required information is submitted to the HttpPost object, a connection is made.
If the connection is established the message can be sent to the recipient. A code which sends a SMS message might look like this:
<cfset strServer="post.activexperts-labs.com">
<cfset strPort="8080">
<cfset strUrlText="/sendsms/default.asp?username=C6046231DB&password=EDB88EB2FE&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%">
<cfset
strUrlUnicode="/sendsms/default.asp?username=C6046231DB&password=EDB88EB2FE&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%&unicode=1">
<cfset strSuccessResponse="id:">
<cfset strErrorResponse="ERR">
<cfset strSender="+31638740160">
<cfset strRecipient="">
<cfset strMessage="">
<cfset numLastError="">
<cfset strLastError="">
<cfset strLastResponse="">
<cfset strUnicode="Checked">
<cfif( isDefined("FORM.CTL_SEND") )>
<cfobject class="ActiveXperts.SmsProtocolHttp" type="com" name="objHttpPost" Action="Create">
<cfobject class="ActiveXperts.SmsMessage" type="com" name="objMessage" Action="Create">
<cfobject class="ActiveXperts.SmsConstants" type="com" name="objConstants" Action="Create">
<cfparam name="FORM.CTL_URLTEXT" default="">
<cfparam name="FORM.CTL_URLUNICODE" default="">
<cfparam name="FORM.CTL_SUCCESSRESPONSE" default="">
<cfparam name="FORM.CTL_ERRORRESPONSE" default="">
<cfparam name="FORM.CTL_SENDER" default="">
<cfparam name="FORM.CTL_RECIPIENT" default="">
<cfparam name="FORM.CTL_MESSAGE" default="">
<cfparam name="FORM.CTL_UNICODE" default="">
<cfparam name="FORM.CTL_HOSTPORT" default="">
<cfscript>
objMessage.Clear();
objMessage.Sender = FORM.CTL_SENDER;
if ( FORM.CTL_UNICODE neq "" ){
objMessage.Format = 20;
strUnicode = "Checked";
}
else{
objMessage.Format = 0;
strUnicode = "";
}
objMessage.Data = FORM.CTL_MESSAGE;
objMessage.Recipient = FORM.CTL_RECIPIENT;
objHttpPost.Clear();
objHttpPost.ProviderHost = FORM.CTL_HOST;
if ( FORM.CTL_HOSTPORT neq "" ){
objHttpPost.ProviderPort = FORM.CTL_HOSTPORT;
}
else{
objHttpPost.ProviderPort = 80;
}
objHttpPost.URLText = FORM.CTL_URLTEXT;
objHttpPost.URLUnicode = FORM.CTL_URLUNICODE;
objHttpPost.ProviderSuccessResponse = FORM.CTL_SUCCESSRESPONSE;
objHttpPost.ProviderErrorResponse = FORM.CTL_ERRORRESPONSE;
objHttpPost.Send( objMessage );
numLastError = objHttpPost.LastError;
strLastError = objHttpPost.GetErrorDescription( numLastError );
strLastResponse = objHttpPost.ProviderResponse;
</cfscript>
</cfif>
There are many working samples included with the product.
You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/xmstoolkit.
The ActiveXperts SMS and MMS Toolkit is a SMS development component (SDK). This control can be used by any Windows development platform,
including Visual Basic .NET, Visual CSharp .NET,
ASP .NET (VB,CS),
ASP,
Visual Basic,
Visual Basic for Applications (VBA),
Visual Studio/Visual C++,
Borland Delphi and
C++ Builder,
PHP,
ColdFusion,
HTML,
VBScript and any other ActiveX/COM compliant platform. The SMS and MMS Toolkit is an ActiveXperts Software B.V. Product.
|