Download ActiveXperts SMS and MMS Toolkit 5.1  (6804 KB - .exe file)
Download Manual  (623 KB - .htm file)
Using SMS and MMS Toolkit with ASP 2.x (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 ASP 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 Web Site
First, create a new directory on the IIS Server's file system. This directory will hold the ASP later on.
From the 'Start menu', click on 'Administrative Tools' and click on 'Internet Information Services (IIS) Manager'. Right-click on the 'Web Sites' container and choose 'New->Web Site':

(Click on the picture to enlarge)
The 'Web Site Creation Wizard' is shown, guiding you thorugh the process of creating a new web site. Provide all necessary information:
- Description - a froendly description of the new site;
- IP / Port / Host Header - choose your preferred way to distinguish between other web sites on the server;
- Path - select the directory that will store the ASP file(s);
- Web Site Access Permissions - in the Web Site Access Permissions dialog, enable 'Read' and 'Run scripts (such as ASP)';
You're now able to write an ASP script to send MMS content using the ActiveXperts SMS and MMS Toolkit.
Step 3: Create the SMS and MMS Toolkit objects in ASP
Create a new ASP script called DEFAULT.ASP in the directory that was created in Step2, using your favorite editor.
On top of the ASP code, insert the following lines to declare the MMS objects:
<%
Dim objMmsConstants
Dim objMm1Protocol
Dim objMmsMessage
Dim objMmsSlide
%>
Insert the following lines to create the objects:
<%
Set objMmsConstants = Server.CreateObject ( "ActiveXperts.MmsConstants" )
Set objMm1Protocol = Server.CreateObject ( "ActiveXperts.MmsProtocolMm1" )
Set objMmsMessage = Server.CreateObject ( "ActiveXperts.MmsMessage" )
Set objMmsSlide = Server.CreateObject ( "ActiveXperts.MmsSlide" )
%>
Step 4: Test a small piece of ASP
Now, test if your new web site is working well with the SMS and MMS Toolkit using your browser.
If you are using Microsoft Internet Explorer, it is recommended to disable friendly error message because this default setting doesn't show any ASP error message, making it hard to debug if there are any problems:
- Choose' Internet Options' from the 'Tools' menu;
- Select the 'Advanced' tab;
- In the 'Browsing' folder, de-select the 'Show friendly HTTP error messages' option;
- Click 'OK' to close the dialog.
Now, use the following piece of code in your DEFAULT.ASP page:
<%
Dim objMmsConstants
Dim objMm1Protocol
Dim objMmsMessage
Dim objMmsSlide
%>
<%
Set objMmsConstants = Server.CreateObject ( "ActiveXperts.MmsConstants" )
Set objMm1Protocol = Server.CreateObject ( "ActiveXperts.MmsProtocolMm1" )
Set objMmsMessage = Server.CreateObject ( "ActiveXperts.MmsMessage" )
Set objMmsSlide = Server.CreateObject ( "ActiveXperts.MmsSlide" )
%>
<html>
<head>
<title>MMS Toolkit Demo</title>
</head>
<body>
MMS Toolkit version: <% = objMm1Protocol.Version %><br>
MMS Toolkit expiration date: <% = objMm1Protocol.ExpirationDate %><br>
</body>
</html>
And test it with your favorite browser. The result should be like this:

(Click on the picture to enlarge)
Step 5: Send MMS messages
You can now send MMS messages using a connected GSM GPRS/EDGE/UMTS modem.
The following ASP code generates a website where the user can choose a GIF image,
and send it as a MMS message to his mobile phone or email address.
The demo can be run from a client connecting to the ASP webserver. The client does not need any additional hardware.
The modem has to be connected to the webserver.
The following ASP code shows how to send a MMS:
<%
'declare the variables
Public strSource, objMm1Protocol, objMmsMessage, objMmsSlide, objMmsConstants, strResult
page_load
'###############################################################################
Sub page_load()
'Set some variables
strSource = ReadRegistry("HKEY_LOCAL_MACHINE\SOFTWARE\ActiveXperts\SMS and MMS Toolkit\InstallRoot")
strSource = strSource + "\Providers\Mms\Mm1"
strResult = ""
set objMm1Protocol = nothing
set objMmsMessage = nothing
set objMmsSlide = nothing
set objMmsConstants = nothing
If request("submitbutton") <> "" Then
sendMMS
End If
End Sub
'###############################################################################
'function for reading the registry
Function ReadRegistry(strRegKey)
Dim WshShell
Set WshShell = server.CreateObject("WScript.Shell")
ReadRegistry = WshShell.Regread(strRegKey)
End Function
'###############################################################################
'function for displaying the files
Function ViewFiles(strSource, strType)
'declare the variables
Dim objFs
Dim objFolder
'create the objects
Set objFs = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFs.GetFolder(strSource)
'display folders
If strType = "folders" then
'display other folders
For Each objItem In objFolder.SubFolders
%>
<option value="<% = objItem.Name %>"><% = objItem.Name %></option>
<%
Next
'display files
elseif strType = "files" then
'display all files
For Each objItem In objFolder.Files
%>
<option value="<% = replace(objItem.Name, ".mm1", "") %>"><% = replace(objItem.Name, ".mm1", "") %></option>
<%
Next
End If
End Function
'###############################################################################
'show the selected dropdown items
Function ShowChosenOption(strURLVar, strType)
Dim fs
Dim file
Dim strString
file = strSource + "\" + request("country") + "\" + request("provider") + ".mm1"
strString = request(strURLVar)
set fs=Server.CreateObject("Scripting.FileSystemObject")
If strType = "file" Then
if fs.FileExists(file) = true and strString <> "" then
%>
<option value="<% = strString %>"><% = strString %></option>
<%
End if
Elseif strType = "folder" Then
if strString <> "" Then
%>
<option value="<% = strString %>"><% = strString %></option>
<%
End If
End If
End Function
'###############################################################################
'function for declaring the objects
Function createActiveXpertsObjects()
If objMm1Protocol is nothing then
Set objMm1Protocol = CreateObject ( "ActiveXperts.MmsProtocolMm1" )
Set objMmsMessage = CreateObject ( "ActiveXperts.MmsMessage" )
Set objMmsSlide = CreateObject ( "ActiveXperts.MmsSlide" )
Set objMmsConstants = CreateObject ( "ActiveXperts.MmsConstants" )
End If
End Function
'###############################################################################
'function to list the devices
Function getdevice()
createActiveXpertsObjects
For i = 0 To objMm1Protocol.GetDeviceCount() - 1
%>
<option value="<% = objMm1Protocol.GetDevice(i) %>"><% = objMm1Protocol.GetDevice(i) %></option>
<%
Next
End Function
'###############################################################################
'the function to send the mms
Function sendMMS()
'create the activexperts variables
createActiveXpertsObjects
'declare the variables
Dim strMm1
'get the MM1 file
strMm1 = strSource + "\" + request("country") + "\" + request("provider") + ".mm1"
'configure the message
objMmsMessage.Clear()
objMmsMessage.Subject = request("subject")
objMmsMessage.AddRecipient( request("phonenumber") )
'create a slide
objMmsSlide.Clear()
objMmsSlide.Duration = 10
objMmsSlide.AddAttachment( Server.MapPath(".") + "\" + request("img") )
objMmsSlide.AddText( request("text") )
'add a slide
objMmsMessage.AddSlide( objMmsSlide )
'fill in the device
If objMm1Protocol.LastError = 0 then
objMm1Protocol.Device = request("device")
End if
'enter the pincode
If request("pin") <> "" and objMm1Protocol.LastError = 0 then
objMm1Protocol.EnterPin(request("pin"))
End If
'load the configuration file and connect to the server
If objMm1Protocol.LastError = 0 then
objMm1Protocol.ProviderLoadConfig( strMm1 )
objMm1Protocol.Connect()
End If
'send the mms
If objMm1Protocol.LastError = 0 then
objMm1Protocol.Send ( objMmsMessage )
End If
strResult = objMm1Protocol.LastError & " : " & objMm1Protocol.GetErrorDescription(objMm1Protocol.LastError)
'disconnect
objMm1Protocol.Disconnect()
End Function
%>
<html>
<head>
<title>ActiveXperts SMS and MMS Toolkit sample in ASP</title>
<style type="text/css">
<!--
select{
width: 300px;
border: 1px solid black;
font-family: verdana;
font-size: x-small;
color: black;
}
input{
width: 300px;
border: 1px solid black;
font-family: verdana;
font-size: x-small;
background-color: white;
color: black;
}
div{
width: 300px;
border: 1px solid black;
}
input.radio{
height: 39px;
width: 20;
border: 0px solid black;
font-family: verdana;
font-size: x-small;
background-color: white;
color: black;
}
table{
width: 562px;
border: 1px solid black;
font-family: verdana;
font-size: x-small;
color: black;
}
h2{
font-family: verdana;
font-weight: bold;
color: black;
}
-->
</style>
</head>
<body>
<center>
<h2>
ActiveXperts SMS and MMS Toolkit sample<br>
in ASP
</h2>
<form name=mmsform method="get">
<input type=hidden name="action" value="ok">
<table>
<tr>
<td>Select your device<font color=red>*</font>:</td>
<td>
<select name=device>
<% getdevice() %>
</select>
</td>
</tr>
<tr>
<td>Type down your pincode:</td>
<td><input type=text name=pin value="<% = request("pin") %>"></td>
</tr>
<tr>
<td>Select your country<font color=red>*</font>:</td>
<td>
<select name="country" onchange="submit();">
<% ShowChosenOption "country", "folder" %>
<% viewFiles strSource, "folders" %>
</select>
</td>
</tr>
<tr>
<td>Select your provider<font color=red>*</font>:</td>
<td>
<select name="provider">
<% if request("country") <> "" then %>
<% strSource = strSource + "\" + request("country") %>
<% ShowChosenOption "provider", "file" %>
<% viewFiles strSource, "files" %>
<% end if %>
</select>
</td>
</tr>
<tr>
<td>Phone number<font color=red>*</font>:</td>
<td><input type=text name=phonenumber value="<% = request("phonenumber") %>"></td>
</tr>
<tr>
<td>From:</td>
<td><input type=text name=from value="<% = request("from") %>"></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type=text name=subject value="<% = request("subject") %>"></td>
</tr>
<tr>
<td valign=top>Select the image you want to send<font color=red>*</font>:</td>
<td><div><input type=radio class=radio name=img value="img1.gif"><img src="img1.gif" alt=""></div></td>
</tr>
<tr>
<td> </td>
<td><div><input type=radio class=radio name=img value="img2.gif"><img src="img2.gif" alt=""></div></td>
</tr>
<tr>
<td> </td>
<td><div><input type=radio class=radio name=img value="img3.gif"><img src="img3.gif" alt=""></div></td>
</tr>
<tr>
<td> </td>
<td><div><input type=radio class=radio name=img value="img4.gif"><img src="img4.gif" alt=""></div></td>
</tr>
<tr>
<td>Message text:</td>
<td><input type=text name=text value="<% = request("text") %>"></td>
</tr>
<tr>
<td> </td>
<td><input name=submitbutton type=submit value="Send MMS" onclick="alert('Please wait a moment...')"></td>
</tr>
</table>
</form>
<table>
<tr>
<td><b>Result</b>: <% = strResult %></td>
</tr>
</table>
</center>
</body>
</html>
You can find the sample images used in this sample below:
There are many working samples included with the product.
You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/ammstool.
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.
|