ActiveXperts SMS and MMS Toolkit Manual

© 2010 ActiveXperts Software B.V.  contact@activexperts.com

 

Table of Contents

PART I: GETTING STARTED

  1. Introduction
  2. System Requirements
  3. Installation

Part II: SMS

  1. SMS messaging with SMS and MMS Toolkit
  2. SMS constants
  3. SmsMessage object
  4. SmsProtocolGsm object
  5. SmsProtocolHttp object
  6. SmsProtocolSmpp object
  7. SmsProtocolDialup object
  8. SmsData objects (WAP Push, WAP Bookmark, vCards and MMS notifications)
  9. SmsDeliveryStatus Object

Part III: PAGING

  1. Pager messaging with SMS and MMS Toolkit
  2. PagerMessage object
  3. PagerProtocolSnpp object

Part IV: MMS

  1. MMS messaging with SMS and MMS Toolkit
  2. MMS constants
  3. MmsMessage and MmsSlide objects
  4. MmsProtocolMm1 object
  5. MmsProtocolMm4 object
  6. MmsProtocolMm7 object

PART V: Support, Licensing

  1. Support
  2. Purchase and product activation
  3. Appendix A: License Agreement

1. Introduction

1.1. What is the ActiveXperts SMS and MMS Toolkit?

Adding SMS, MMS and Pager capabilities to an application is not a simple matter. It requires specialized knowledge that might be outside an individual programmer's expertise. Today, Windows developers rely upon the power, flexibility and reliability of the SMS and MMS Toolkit by ActiveXperts Software.

SMS and MMS Toolkit is an ActiveX/COM component, and provides SMS, MMS and Pager messaging functionality.

With this Toolkit, you can send and receive SMS messages via a:

With this Toolkit, you can also send MMS messages via an:

With this Toolkit, you can also send pager messages via an:

SMS and MMS Toolkit can be used by any of the following operating systems:

SMS and MMS Toolkit can be used by any of the following development languages:

1.2. SMS and MMS Toolkit features

SMS features:

MMS features:

Pager features:

Generic:

1.3. SMS and MMS Toolkit Architecture

The core of SMS and MMS Toolkit is an ActiveX/COM component that comes in a 32-bit and a 64-bit version:

The component encapsulates the following SMS objects:

The component encapsulates the following Pager objects:

The component encapsulates the following MMS objects:

SMS and MMS Toolkit can be distributed easily to many PC's. Once you have purchased the licenses, you copy the AXmsCtrl.dll to the PCs and register the DLL on that PC. Click here for more information about the installation.

2. System requirements

2.1. Supported Operating Systems

SMS and MMS Toolkit can be used by any of the following operating systems:

2.2. Supported Development Platforms

The SMS and MMS Toolkit can be used by any of the following programming languages:

3. Installation

The SMS and MMS Toolkit package consists of 3 components; any combination of components can be installed:

3.1. Installation on a single computer

Simply run the AXMSTOOL.EXE Setup program. The InstallShield wizard will guide you through the rest of the setup.
If you choose the SMS and MMS Toolkit COM component, the Setup program can perform the registration of the COM component for you. But it will also give you the opportunity to register the object yourself.

Any subsequent installation of SMS and MMS Toolkit can be performed either manually or by using the Setup program.

3.2. Installation on multiple computers

Any subsequent installations can be performed using the setup program.
But since the installation of the core components is very simple, you may want to do it manually, or integrate it into your companies software distribution program.

If you choose to install the COM component manually on other machines, simply perform the following actions:

4. SMS Messaging with SMS and MMS Toolkit

4.1. Introduction

With ActiveXperts SMS and MMS Toolkit, you can send and receive SMS messages via a GSM/GPRS modem, GSM/GPRS phone, SMS/HTTP provider, SMPP provider or Hayes compatible modem. You can send/receive not only plain text messages, but also multi-part messages, Unicode SMS messages and SMS data messages including WAP Push, WAP Bookmark, vCard and MMS notification messages. The following code snippets (VBScript) illustrate how to use various SMS and MMS Toolkit objects for sending/receiving SMS messages.

Send a text SMS message via GSM/GPRS Modem
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+31624896641"                                  ' Set recipient's mobile number
objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

objGsmProtocol.Device    = "MultiTech GSM MultiModem"                      ' Use MultiTech's Windows Telephony device 
objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code
objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message now
WScript.Echo "Result: " & objGsmProtocol.LastError
Send a text SMS message via HTTP
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

objSmsMessage.Recipient  = "+31624896641"                                  ' Set recipient's mobile number
objSmsMessage.Sender     = "+31638740160"                                  ' Set sender   
objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

' Provider Settings
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Set host
objHttpProtocol.ProviderPort = 8080                                        ' Set port (default port:80)
  
' Provider Response templates
objHttpProtocol.ProviderErrorResponse = "ERR"                              ' Response should NOT contain 'ERR'
objHttpProtocol.ProviderSuccessResponse = "id"                             ' Response should contain 'id'

' URL Template to submit plain text SMS messages
objHttpProtocol.URLText  = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=" & _
                           "%MESSAGERECIPIENT%&from=%MESSAGESENDER%"   
  
objHttpProtocol.Send( objSmsMessage )                                      ' Send the message   
WScript.Echo "Send, result:" & objHttpProtocol.LastError                   ' Display the result  
WScript.Echo "Provider response:" & objHttpProtocol.ProviderResponse       ' Display provider response
Send a text SMS message via SMPP
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' Set SMPP server (hostname or IP address)
objSmppProtocol.ServerPort =  2775                                         ' Set TCP/IP port of the SMPP server
objSmppProtocol.SystemID = "AX005"                                         ' Set SMPP server login
objSmppProtocol.SystemPassword = "812056"                                  ' Set SMPP server password
objSmppProtocol.Connect
If objSmppProtocol.IsConnected = True Then
  objSmsMessage.Recipient= "+31624896641"                                  ' Set recipient's mobile number
  objSmsMessage.Data     = "Hello World via SMPP"                          ' Set SMS message text
  objSmppProtocol.Send( objSmsMessage )                                    ' Send the message
  objSmppProtocol.Disconnect                                               ' Disconnect
End If
WScript.Echo "Result: " & objSmppProtocol.LastError
Send a text SMS message via Dial-up provider
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objDialupProtocol    = CreateObject( "ActiveXperts.SmsProtocolDialup" )' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

objSmsMessage.Recipient  = "0624896641"                                    ' Set recipient's mobile number
objSmsMessage.Sender     = "0638740160"                                    ' Set message sender   
objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text

objDialupProtocol.Device = "Standard 1200 bps Modem"                 
objDialupProtocol.DeviceSpeed = 1200                                       ' Provider-dependent; 0 for default (TAP 1200, 
                                                                             UCP 2400)
objDialupProtocol.DeviceSettings = objSmsConstants.asDEVICESETTINGS_8N1    ' Provider-dependent; here we use 8 data bits,
                                                                           ' no parity, 1 stop-bit
objDialupProtocol.ProviderDialString = "+31653141414"                      ' Provider's dial-in number
objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP        ' UCP or TAP
objDialupProtocol.Send ( objSmsMessage )                     
WScript.Echo "Result: " & objDialupProtocol.LastError
Receive a text SMS message through GSM/GPRS Modem
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

objGsmProtocol.Device    = "MultiTech GSM MultiModem"
objGsmProtocol.EnterPin ( "1234" )                                         ' SIM card's PIN code

objGsmProtocol.MessageStorage = objSmsConstants.asSTORAGE_ALL              ' Set memory to any available storage location 
objGsmProtocol.Receive()                                                   ' Receive all messages from any memory location 

If( objGsmProtocol.LastError <> 0 ) Then 
  WScript.Echo "Failed to receive, error: " & objGsmProtocol.LastError
  WScript.Quit
End If

Set objSmsMessage        = objGsmProtocol.GetFirstMessage()                ' Get first message

While ( objGsmProtocol.LastError = 0 ) 
  WScript.Echo "Message from: " & objSmsMessage.Sender                     ' Show sender's mobile number
  wScript.Echo "Message : "     & objSmsMessage.Data                       ' Show the SMS message text
  Set objSmsMessage      = objGsmProtocol.GetNextMessage()                 ' Get next message
Wend
Send a Unicode SMS message via GSM/GPRS Modem
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

objSmsMessage.Recipient  = "+31624896641"                                  ' Recipient's mobile number
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_UNICODE         ' SMS message format
objSmsMessage.Data       = "ملحق خاصملحق خاص"                              ' SMS message text

objGsmProtocol.Device    = "MultiTech GSM MultiModem"   
objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code
objGsmProtocol.Send ( objSmsMessage )                                      ' Send the SMS message now
WScript.Echo "Result: " & objGsmProtocol.LastError
Send a WAP Push message (via SMPP)
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )     ' Create SmsConstants instance

objWapPush.URL           = "http://wap.yahoo.com"                          ' Push wap.yahoo.com
objWapPush.Description   = "Go visit yahoo.com !"                          ' Friendly push text   
objWapPush.Encode                                                          ' Encode the WAP data

objSmsMessage.Recipient  = "+31624896641"                                  ' Recipient's mobile number
objSmsMessage.Data       = objWapPush.EncodedMessage                       ' Assign encoded data to the message
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' SMPP server (hostname or IP address)
objSmppProtocol.ServerPort =  2775                                         ' TCP/IP port of the SMPP server
objSmppProtocol.SystemID = "myaccount"                                     ' SMPP server login
objSmppProtocol.SystemPassword = "mypassword"                              ' SMPP server password
objSmppProtocol.Connect
If objSmppProtocol.IsConnected = True Then
  objSmppProtocol.Send( objSmsMessage )                                    ' Send WAP message
  objSmppProtocol.Disconnect                                               ' Disconnect
End If

4.2. SMS Hardware requirements

SmsProtocolGsm requirements: GSM/GPRS modem or GSM phone with datacable/bluetooth

This is a fast and reliable device to send and receive SMS messages.
You can send plain text SMS messages, unicode messages, multipart messages and other advanced SMS messages using a GSM modem.

To send/receive SMS messages using a GSM modem, use the SmsProtocolGsm object.

ActiveXperts recommends Falcom SAMBA GSM modems and WaveCom GSM modems. For more information, click here.

SmsProtocolSmpp requirements: Internet connection / VPN tunnel.

Customers requiring a high throughput should deliver SMS messsages over a network connection to a remote SMPP-compliant SMSC provider. The SMPP ('Short Message Peer-to-Peer') protocol is a Layer-7 TCP/IP protocol for exchanging SMS messages between SMS peer entities such as short message service centres. It is often used to allow third parties (e.g. content suppliers like news organisations) to submit SMS messages, often in bulk.
To send SMS messages using an SMPP-compliant provider and SMS and MMS Toolkit, use the SmsProtocolSmpp object.

You can use the free ActiveXperts SMPP Demo server (smpp.activexperts-labs.com) to send and receive a limited number of SMPP messages (for testing only). For daily use, you need to sign-up with a commercial SMPP-compliant SMSC provider.

For a list of SMPP providers that have been tested with ActiveXperts SMS and MMS Toolkit, click here: www.activexperts.com/xmstoolkit/smpplist.

SmsProtocolHttp requirements: Internet connection / VPN tunnel.

With the easy-to-configure HTTP interface you can send SMS messages directly from your business applications or websites in minutes. All you need is a subscription with a commercial HTTP- compliant SMS provider, and an internet connection. To send SMS messages using an HTTP-compliant provider and SMS and MMS Toolkit, use the SmsProtocolHttp object.

You can use the free ActiveXperts SMS/HTTP gateway (post.activexperts-labs.com:8080) to send and receive a limited number of SMS/HTTP messages (for testing only). For daily use, you need to sign-up with a commercial HTTP-compliant SMS provider.

SmsProtocolDialup requirements: Hayes compatible modems (1200 bps or higher)

Use SMS and MMS Toolkit connect your normal Hayes modem (1200 bps or higher) to an SMSC service provider and send out SMS messages, one-by-one.
There are many SMSC dial-in providers around the world. Most of them do not require sign-up. You pay per dial-up call. For a complete list of SMSC dial-in providers around the world, click here.

You can only send plain text messages with a normal modem; to send multipart, data, unicode and other advanced SMS formats, you should use a GSM Modem (or GSM phone with modem functionality). You cannot receive SMS messages using a normal Hayes modem.

To use a normal Hayes modem to connect to an SMSC dial-in provider with SMS and MMS Toolkit, use the SmsProtocolDialup object.

4.3. Visual Basic .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual Basic Solution Explorer:

You can create a new SmsMessage object in the following way:

Imports AXmsCtrl
...
Dim objSmsMessage As SmsMessage  = New SmsMessage()

You can create a new SmsConstants object in the following way:

Imports AXmsCtrl
...
Dim objSmsConstants As SmsConstants  = New SmsConstants() 

If you use a GSM modem (or GSM phone) to send and/or receive SMS messages, create a new SmsProtocolGsm object in the following way:

Imports AXmsCtrl
...
Dim objGsmProtocol As SmsProtocolGsm   = New SmsProtocolGsm()

If you use an HTTP-compliant SMSC provider to deliver SMS messages, create a new SmsProtocolHttp object in the following way:

Imports AXmsCtrl
...
Dim objHttpProtocol As SmsProtocolHttp = New SmsProtocolHttp()

If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:

Imports AXmsCtrl
...
Dim objSmppProtocol As SmsProtocolSmpp = New SmsProtocolSmpp()

If you use a normal modem to connect to an SMSC dial-in provider, create a newSmsProtocolDialup object in the following way:

Imports AXmsCtrl
...
Dim objDialupProtocol As SmsProtocolDialup = New SmsProtocolDialup()

If you want to use advanced SMS data objects, you can create a newSmsDataWapPush, SmsDataWapBookmark, SmsDatavCard or SmsDataMmsNotification object in the following way:

Imports AXmsCtrl
...
Dim objWapPush As SmsDataWapPush = New SmsDataWapPush()
Dim objWapBookmark As SmsDataWapBookmark = New SmsDataWapBookmark()
Dim objCard As SmsDatavCard = new SmsDatavCard()
Dim objNotification As SmsDataMmsNotification = New SmsDataMmsNotification()
After these declarations and creation of the object(s), you can use the objects in your Visual Basic .NET projects.

4.4. Visual C# .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual C# Solution Explorer:

You can create a new SmsMessage object in the following way:

using AXmsCtrl;
...
SmsMessage objSmsMessage = new SmsMessage();

You can create a new SmsConstants object in the following way:

using AXmsCtrl;
...
SmsConstants objSmsConstants = new SmsConstants();

If you use a GSM modem (or GSM phone) to send SMS messages, declare and create a new SmsProtocolGsm object in the following way:

using AXmsCtrl;
...
SmsProtocolGsm objGsmProtocol = new SmsProtocolGsm();
If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:
using AXmsCtrl;
...
SmsProtocolHttp objHttpProtocol = new SmsProtocolHttp();
If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:
using AXmsCtrl;
...
SmsProtocolSmpp objSmppProtocol = new SmsProtocolSmpp();
If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object in the following way:
using AXmsCtrl;
...
SmsProtocolDialup objDialupProtocol = new SmsProtocolDialup();
If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDatavCard or SmsDataMmsNotification object in the following way:
using AXmsCtrl;
...
SmsDataWapPush objWapPush = new SmsDataWapPush(); 
SmsDataWapBookmark objWapBookmark = new SmsDataWapBookmark();
SmsDatavCard objCard = new SmsDatavCard();
SmsDataMmsNotification objNotification = new SmsDataMmsNotification();

After these declarations and creation of the object(s), you can use the objects inside your Visual C# .NET code.

4.5. Visual Basic

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual Basic 5.x or higher. In Visual Basic, go to the 'Project/References...' menu item and check the box next to 'ActiveXperts SMS and MMS Toolkit' Type Library. Now, you can declare and create SMS objects.

You can create a new SmsMessage object in the following way:

Dim objSmsMessage As AXmsCtrl.SmsMessage                            
Set objSmsMessage = CreateObject( "ActiveXperts.SmsMessage" ) 

You can create a new SmsConstants object in the following way:

Dim objSmsConstants As AXmsCtrl.SmsConstants                            
Set objSmsConstants = CreateObject( "ActiveXperts.SmsConstants" ) 

If you use a GSM modem (or GSM phone) to send SMS messages, create a new SmsProtocolGsm object using the 'CreateObject' function:

Dim objGsmProtocol As AXmsCtrl.SmsProtocolGsm           
Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )

If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:

Dim objHttpProtocol As AXmsCtrl.SmsProtocolHttp             
Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )

If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:

Dim objSmppProtocol As AXmsCtrl.SmsProtocolSmpp                          
Set objSmppProtocol = CreateObject( "ActiveXperts.SmsProtocolSmpp" )     

If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object using the 'CreateObject' function:

Dim objDialupProtocol As AXmsCtrl.SmsProtocolDialup                     
Set objDialupProtocol = CreateObject( "ActiveXperts.SmsProtocolDialup" )

If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDatavCard or SmsDataMmsNotification object in the following way:

Dim objWapPush As AXmsCtrl.SmsDataWapPush                              
Set objWapPush = CreateObject( "ActiveXperts.SmsDataWapPush" )         

Dim objWapBookmark As AXmsCtrl.SmsDataWapBookmark                      
Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" ) 

Dim objCard As AXmsCtrl.SmsDatavCard
Set objCard = CreateObject ( "ActiveXperts.SmsDatavCard" )

Dim objNotification As AXmsCtrl.SmsDataMmsNotification                      
Set objNotification = CreateObject( "ActiveXperts.SmsDataMmsNotification" )

After these declarations and creation of the object(s), you can use the objects in your Visual Basic projects.

4.6. Visual C++

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual C++ projects. Include the *.h and *.c file provided by ActiveXperts to bind your code to the SMS component. These files are located in the Include directory of the Visual C++ samples directory. These are the files:

You can create a new SmsMessage object in the following way:

ISmsMessage              *pSmsMessage;                         
CoCreateInstance(CLSID_SmsMessage, NULL, CLSCTX_INPROC_SERVER, IID_ISmsMessage, (void**) &pSmsMessage);

If you use a GSM modem (or GSM phone) to send and/or receive SMS messages, declare and create a new SmsProtocolGsm object in the following way:

ISmsProtocolGsm          *pGsmProtocol;
CoCreateInstance(CLSID_SmsProtocolGsm, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolGsm, (void**) &pGsmProtocol);

If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:

ISmsProtocolHttp          *pHttpProtocol; 
CoCreateInstance(CLSID_SmsProtocolHttp, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolHttp, (void**) &pHttpProtocol);

If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:

ISmsProtocolSmpp          *pSmppProtocol;
CoCreateInstance(CLSID_Smpp, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolSmpp, (void**) &pSmppProtocol);

If you use a normal modem to connect to an SMSC dial-in provider, declare and create a new SmsProtocolDialup object in the following way:

ISmsProtocolDialup        *pDialupProtocol;
CoCreateInstance(CLSID_SmsProtocolDialup, NULL, CLSCTX_INPROC_SERVER, IID_ISmsProtocolDialup, (void**) &pDialupProtocol);

To format SMS messages as WAP Push or WAP Bookmark messages, you can create a new SmsDataWapPush or SmsDataWapBookmark object in the following way:

ISmsDataWapPush           *pObjWapPush;
CoCreateInstance(CLSID_SmsDataWapPush, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataWapPush, (void**) &pObjWapPush); 

IWapBookmark              *pObjWapBookmark;
CoCreateInstance(CLSID_SmsDataWapBookmark, NULL,CLSCTX_INPROC_SERVER,IID_ISmsDataWapBookmark,(void**)&pObjWapBookmark);

To format SMS messages as vCard, you can create a new SmsDatavCard object in the following way:

ISmsDatavCard           *pObjCard;                        
CoCreateInstance(CLSID_SmsDatavCard, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDatavCard, (void**) &pObjCard);

To format SMS messages as MMS notification messages, you can create a new SmsDataMmsNotification object in the following way:

ISmsDataMmsNotification   *pNotification;       
CoCreateInstance( CLSID_SmsDataMmsNotification, NULL, CLSCTX_INPROC_SERVER, IID_ISmsDataMmsNotification, 
                  (void**) &pObjNotification);

4.7. Delphi 6.x or higher

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

First, add a reference to the SMS and MMS Toolkit objects:

You can create a new SmsMessage object in the following way:

SmsMessage    :  TSmsMessage;                                     Declaration of the wrapper class
objSmsMessage :  ISmsMessage;                                     Declaration of the interface class
objSmsMessage := SmsMessage.DefaultInterface;                     Creation new instance of the object

You can create a new SmsConstants object in the following way:

SmsConstants    :  TSmsConstants;                                 Declaration of the wrapper class
objSmsConstants :  ISmsConstants;                                 Declaration of the interface class
objSmsConstants := SmsConstants.DefaultInterface;                 Creation new instance of the object

If you use a GSM modem (or GSM phone) to send SMS messages, create a new SmsProtocolGsm object in the following way:

SmsProtocolGsm :  TSmsProtocolGsm;                                Declaration of the wrapper class
objGsmProtocol :  ISmsProtocolGsm;                                Declaration of the interface class
objGsmProtocol := SmsProtocolGsm.DefaultInterface;                Creation new instance of the object

If you use an HTTP-compliant SMSC provider to deliver messages, create a new SmsProtocolHttp object in the following way:

SmsProtocolHttp :  TSmsProtocolHttp;                              Declaration of the wrapper class
objHttpProtocol :  ISmsProtocolHttp;                              Declaration of the interface class
objHttpProtocol := SmsProtocolHttp.DefaultInterface;              Creation new instance of the object

If you use an SMPP-compliant SMSC provider to deliver messages, create a new SmsProtocolSmpp object in the following way:

SmsProtocolSmpp :  TSmsProtocolSmpp;                              Declaration of the wrapper class
objSmppProtocol :  ISmsProtocolSmpp;                              Declaration of the interface class
objSmppProtocol := SmsProtocolSmpp.DefaultInterface;              Creation new instance of the object

If you use a normal modem to connect to an SMSC dial-in provider, create a new SmsProtocolDialup object in the following way:

SmsProtocolDialup :  TSmsProtocolDialup;                          Declaration of the wrapper class
objDialupProtocol :  ISmsProtocolDialup;                          Declaration of the interface class
objDialupProtocol := SmsProtocolDialup.DefaultInterface;          Creation new instance of the object

If you want to use advanced SMS data objects, you can create a new SmsDataWapPush, SmsDataWapBookmark, SmsDatavCard or SmsDataMmsNotification object in the following way:

SmsDataWapPush         :  TSmsDataWapPush;                            Declaration of the wrapper class
objWapPush             :  ISmsDataWapPush;                            Declaration of the interface class
objWapPush             := SmsDataWapPush.DefaultInterface;            Creation new instance of the object

SmsDataWapBookmark     :  TSmsDataWapBookmark;                        Declaration of the wrapper class
objWapBookmark         :  ISmsDataWapBookmark;                        Declaration of the interface class
objWapBookmark         := SmsDataWapBookmark.DefaultInterface;        Creation new instance of the object

SmsDatavCard           :  TSmsDatavCard;                              Declaration of the wrapper class
objCard                :  ISmsDatavCard;                              Declaration of the interface class
objCard                := SmsDatavCard.DefaultInterface;              Creation new instance of the object

SmsDataMmsNotification : TSmsDataMmsNotification;                     Declaration of the wrapper class
objNotification        : ISmsDataMmsNotification;                     Declaration of the interface class
objNotification        := SmsDataMmsNotification.DefaultInterface;    Creation new instance of the object

After these declarations and creation of the object(s), you can use the objects in your Delphi projects.

4.8. ASP 2.x environment

Simply create the objects in the following way:

<html>
<body>
Version:
<script language=vbscript runat=server>
  Set objSmsConstants    = CreateObject( "ActiveXperts.SmsConstants" )
  Set objSmsMessage      = CreateObject( "ActiveXperts.SmsMessage" )
  Set objGsmProtocol     = CreateObject( "ActiveXperts.SmsProtocolGsm" )
  Set objHttpProtocol    = CreateObject( "ActiveXperts.SmsProtocolHttp" )
  Set objSmppProtocol    = CreateObject( "ActiveXperts.SmsProtocolSmpp" )
  Set objDialupProtocol  = CreateObject( "ActiveXperts.SmsProtocolDialup" )
  Set objWapPush         = CreateObject( "ActiveXperts.SmsDataWapPush" )
  Set objWapBookmark     = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
  Set objCard            = CreateObject( "ActiveXperts.SmsDatavCard" )
  ...
  Set objMmsConstants    = CreateObject( "ActiveXperts.MmsConstants" )
  Set objMmsMessage      = CreateObject( "ActiveXperts.MmsMessage" )
  Set objMm1Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm1" )
  Set objMm4Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm4" )
  Set objMm7Protocol     = CreateObject( "ActiveXperts.MmsProtocolMm7" )
  ...
  Response.Write objGsmProtocol.Version
  ...
</script>
</body>
</html>

5. SMS Constants

In SMS and MMS Toolkit, all SMS constants are grouped together in a separate object called SmsConstants. You must first create the SmsConstants object before you can actually use the constant:

Set objSmsConstants = CreateObject( "ActiveXperts.SmsConstants" )
WScript.Echo objSmsConstants.asDIALMODE_TONE
WScript.Echo objSmsConstants.asDIALMODE_PULSE
...

5.1. SMS Message Formats

Name Description
asMESSAGEFORMAT_TEXT Standard Text message (GSM)
asMESSAGEFORMAT_TEXT_FLASH Standard Text message, immediate display
asMESSAGEFORMAT_TEXT_MULTIPART Standard Text message, multipart
asMESSAGEFORMAT_TEXT_MULTIPART_FLASH Standard Text message, multipart, immediate display
asMESSAGEFORMAT_DATA Data message (raw 8 bit data)
asMESSAGEFORMAT_DATA_UDH Data message with User Data Header ( ringtones, logo's, ... )
asMESSAGEFORMAT_UNICODE Unicode Message (UCS2)
asMESSAGEFORMAT_UNICODE_FLASH Unicode Message, immediate display
asMESSAGEFORMAT_UNICODE_MULTIPART Unicode Message, multipartimmediate display
asMESSAGEFORMAT_UNICODE_MULTIPART_FLASH Unicode Message, multipart, flash

5.2. GSM Storage Types

Name Description
asSTORAGE_ALL Use all available memory storage locations (default)
asSTORAGE_SIM Use SIM Memory
asSTORAGE_DEVICE Use Device Memory
asSTORAGE_COMBINED Use SIM and device memory
asSTORAGE_REPORTS Use special Reports memory of the device. Only advanced GSM modems have such a Reports memory

5.3. SMPP Versions

Name Description
asSMPPVERSION_33 v 3.3
asSMPPVERSION_34 v 3.4
asSMPPVERSION_50 v 5.0

5.4. SMPP Modes

Name Description
asSMPPMODE_TRANSCEIVER SMPP in send/receive mode (only supported for SMMP 3.4 and higher)
asSMPPMODE_TRANSMITTER SMPP in send-only mode
asSMPPMODE_RECEIVER SMPP in receive-only mode

5.5. SMPP Character Sets

Name Description
asSMPPCHARSET_DEFAULT Use SMSC (provider) default charset
asSMPPCHARSET_GSM Use GSM charset
asSMPPCHARSET_ASCII Use ASCII charset
asSMPPCHARSET_LATIN Use ISO8859-1 charset
asSMPPCHARSET_JIS Use JIS charset
asSMPPCHARSET_CYRILLIC Use Cyrillic charset
asSMPPCHARSET_HEBREW Use Hebrew charset
asSMPPCHARSET_JAPANESE Use Japanase (iso_2022) charset
asSMPPCHARSET_GREEK Use Greek (iso_8859_7) charset

5.6. SMPP Delivery Report Formats

Name Description
asSMPPDELIVERYREPORTFORMAT_HEX The deliveryreport contains the messagereference in hexadecimal format.
asSMPPDELIVERYREPORTFORMAT_DEC The deliveryreport contains the messagereference in decimal format.

5.7. SMS Delivery Status codes

Name Description
asDELIVERYSTATUS_SCHEDULED Scheduled
asDELIVERYSTATUS_ENROUTE Enroute
asDELIVERYSTATUS_DELIVERED Delivered
asDELIVERYSTATUS_EXPIRED Expired
asDELIVERYSTATUS_DELETED Deleted
asDELIVERYSTATUS_UNDELIVERABLE Undeliverable
asDELIVERYSTATUS_ACCEPTED Accepted
asDELIVERYSTATUS_UNKNOWN Unknown
asDELIVERYSTATUS_REJECTED Rejected
asDELIVERYSTATUS_SKIPPED Skipped
asDELIVERYSTATUS_SUBMITREQUESTED Message is submitted to provider and is waiting for ACK
asDELIVERYSTATUS_SUBMITTED Message submitted and ACK-ed by provider
asDELIVERYSTATUS_FAILED Failed
asDELIVERYSTATUS_NOCREDITS Out of SMS credits

5.8. SMS WAP Push Constants

Name Description
asWAPPUSHSIGNAL_NONE A WAP Push message without an alert
asWAPPUSHSIGNAL_LOW Priority of the WAP Push message (Low)
asWAPPUSHSIGNAL_MEDIUM Priority of the WAP Push message (Medium)
asWAPPUSHSIGNAL_HIGH Priority of the WAP Push message (High)
asWAPPUSHSIGNAL_DELETE Delete a WAP Push message

Name Description
asWAPPUSH_SERVICE_INDICATION A Service Indication WAP Push message
asWAPPUSH_SERVICE_LOAD A Service Load WAP Push Message

Name Description
asWAPPUSH_ACTION_EXECUTE_LOW Execute with user intervention
asWAPPUSH_ACTION_EXECUTE_HIGH Execute without user intervention
asWAPPUSH_ACTION_CACHE Cache URL for faster loading

5.9. SMS Dialup Provider Type

Name Description
asPROVIDER_TYPE_UCP UCP compliant SMS/Paging service provider
asPROVIDER_TYPE_TAP_DEFAULT Standard TAP provider
asPROVIDER_TYPE_TAP_NOLF TAP provider, no request for LineFeed
asPROVIDER_TYPE_TAP_NOEOT TAP provider, no request for EOT

5.10. SMS Dial Mode

Name Description
asDIALMODE_TONE Use tone dialing (DTMF)
asDIALMODE_PULSE Use pulse dialing

5.11. SMS Device Settings

Name Description
asDEVICESETTINGS_DEFAULT Use default settings. In case of a Windows telephony, the settings are inherited. In case of a direct COM port, it used 8 data bits, no parity and 1 stop bit
asDEVICESETTINGS_8N1 8 data bits, no parity, 1 stop bit
asDEVICESETTINGS_7E1 7 data bits, even parity, 1 stop bit

5.12. Modem Flow Control Settings

Name Description
asFLOWCONTROL_DEFAULT Use default settings (defined through the Windows Control Panel)
asFLOWCONTROL_DISABLE Disable flow control
asFLOWCONTROL_ENABLE Enable flow control

5.13. SmsDataMmsNotification constants

Name Description
asMMS_CLASS_PERSONAL Personal
asMMS_CLASS_ADVERTISEMENT Commercial
asMMS_CLASS_INFORMATIONAL Informational
asMMS_CLASS_AUTO Auto

5.14. TLV constants

Name Description
asSMPP_TLV_1BYTE 1 Byte TLV Value
asSMPP_TLV_2BYTE 2 Byte TLV Value
asSMPP_TLV_4BYTE 4 Byte TLV Value
asSMPP_TLV_COCTET Zero terminated TLV Value
asSMPP_TLV_OCTET Data TLV Value

6. SmsMessage Object

6.1. SmsMessage Object - Introduction

The SmsMessage object includes all properties of an SMS message. It is used for incoming- and outgoing SMS messaging, and is used by all SMS protocol objects:

You can send and receive different types of SMS messages:

Create a new SMS message

The following sample shows how to create a new SMS message so it can be sent through one of the available SMS protocols:

Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage object

objSmsMessage.Recipient  = "+4412345678"                                   ' Set recipient's mobile number 
objSmsMessage.Data       = "Hello, world!"                                 ' Set SMS message text 
objSmsMessage.RequestDeliveryStatus = False                                ' Set delivery report request
objSmsMessage.ValidityPeriod = 0                                           ' Set GSM operator's retry time

6.2. SmsMessage Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Sender String In/Out O SMS number of the sender
Recipient String In/Out M SMS number of the recipient
Format Number In/Out O Message format (like: plain text, unicode, etc.)
Data String In/Out O Message body. Either plain text characters, or binary data
ValidityPeriod Number In/Out O Retry time (in minutes)
RequestDeliveryStatus Boolean In/Out O Request a delivery report, to ensure delivery
TimeSecs Number Out n/a Time that the message was received
Time String Out n/a Time (formatted string) that the message was received

Property Type In/Out Mand/Opt Description
SMSC String Out n/a SMSC number of the sending provider
ServiceType String In/Out O Some providers require that you set the type of SMS application for each message
PID Number Out n/a The 'protocol_id' parameter
DCS Number Out n/a The 'data_coding' parameter
ESM Number Out n/a The 'esm_class' parameter
SourceTON Number In/Out O SMPP client's TON (Type Of Number) (outgoing SMPP SMS messages only)
SourceNPI Number In/Out O SMPP client's NPI (Numbering Plan Indicator) (outgoing SMPP SMS messages only)
DestinationTON Number In/Out O SMPP server's TON (Type Of Number) (outgoing SMPP SMS messages only)
DestinationNPI Number In/Out O SMPP server's NPI (Numbering Plan Indicator) (outgoing SMPP SMS messages only)

Function Description
Clear Clear all properties

6.3. SmsMessage Object - Properties

SmsMessage.Sender property

Type:

String

Applies to:

All SMS protocols

Description:

The Sender address (incoming messages only)

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.Connect()
...
Set objSmsMessage        = objSmppProtocol.GetFirstMessage
While ( objSmppProtocol.LastError = 0 )
  WScript.Echo "Message received, sender: & objSmsMessage.Sender
  ...
  Set objSmsMessage      = objSmppProtocol.GetNextMessage
WEnd
...
objSmppProtocol.Disconnect()

SmsMessage.Recipient property

Type:

String

Applies to:

All SMS protocols

Description:

The Recipient address, which means: the SMS number of the person that should receive the message. The length of the field must be between 4 and 20 digits.

Two SMS number formats are supported:

To send a message to a specific application or port on the remote mobile phone, you can add a port to the recipient number.
Use the following format:
    <+mobilenumber>:<port>
For instance, to send a message to an application that is listening on port 1234 on user's mobile phone +31624896641, set the Recipient property as follows:
    objSmsMessage.Recipient = "+31624896641:1234" Application ports can only be used for plain text messages and Unicode messages (single- and multipart).

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_TEXT   
objSmsMessage.Recipient  = "+31624896641"                   

objGsmProtocol.Device    = "Nokia 6310i GSM"               
objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

SmsMessage.Format property

Type:

Number

Applies to:

All SMS protocols

Description:

An SMS message can have different types, like: plain text, flash, unicode and more. The 'Format' property indicates the type of data that is stored in the Data property, which will be sent out by the Send function.

You can assign the following values to the 'Format' property:

Example: Send a SMS

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_TEXT   
objSmsMessage.Recipient  = "+31624896641"                   

objGsmProtocol.Device    = "Nokia 6310i GSM"               
objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

SmsMessage.Data property

Type:

Data

Applies to:

All SMS protocols

Description:

The actual message data. Depending on the Format property, the data contains of plain text characters or binary data.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_TEXT   
objSmsMessage.Recipient  = "+31624896641"                   

objGsmProtocol.Device    = "Nokia 6310i GSM"               
objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

SmsMessage.ValidityPeriod property

Type:

Number

Applies to:

Gsm
Smpp

Description:

Specifies the preferred retry time, in minutes. Only applies to outgoing GSM- and SMPP SMS messages. The retry time is used by the GSM/SMPP operator. When a message cannot be delivered to the recipient (for instance because the remote GSM phone is switched off), the operator will try to resend the message for a maximum of 'ValidityPeriod' minutes. After that, the message fails.
If 0 (default value) is specified, the default retry time of the operator is used.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )

objSmsMessage.Data       = "Hello, world!"                                 
objSmsMessage.Recipient  = "+31624896641"                   
objSmsMessage.ValidityPeriod = 10                                          ' When message fails, operator will retry for 
                                                                           ' a maximum of 10 minutes
objGsmProtocol.Device    = "Nokia 6310i GSM"               
objGsmProtocol.Send( objSmsMessage )                                       ' Send the SMS message

SmsMessage.RequestDeliveryStatus property

Type:

Boolean

Applies to:

Gsm
Smpp

Description:

Set the property if you wish to receive status report info from the mobile operator.
A status report can be used to verify the delivery of an SMS message. By default, 'RequestDeliveryStatus' is disabled because it is not supported by all GSM modems.

If the property is enabled, use the SmsProtocolGsm::QueryStatus or SmsProtocolSmpp::QueryStatus function to query for status report information.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
...
objSmsMessage.RequestDeliveryStatus = True
objSmsMessage.Recipient  = "+4412345678"
strMessageReference = objGsmProtocol.Send( objSmsMessage )
If( objGsmProtocol.LastError <> 0 ) Then
  WScript.Quit
End If

WScript.Echo "MessageReference of last sent message: " & strMessageReference
WScript.Sleep 60000                                                        ' Wait for 60 secs to allow operator to 
                                                                           ' deliver the message
Set objStatusDelivery    = objGsmProtocol.QueryStatus(strMessageReference) ' Query the status of the message
If( objGsmProtocol.LastError = 0 ) Then
  WScript.Echo "Status: " & objStatusDelivery.Status
  WScript.Echo "Status Description: " & objStatusDelivery.StatusDescription
End If

SmsMessage.Time
SmsMessage.TimeSeconds properties

Type:

String, Number

Applies to:

All SMS protocols

Description:

'Time' and 'TimeSeconds' indicate the time the SMS message was received. Both properties only apply to incoming GSM- and SMPP SMS messages.
'TimeSeconds' is formatted as a number, and indicates the number of seconds from 1/1/1970; 'Time' formats this number as a friendly string.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
...
objGsmProtocol.Receive()
If( objGsmProtocol.LastError = 0 ) Then
  Set objSmsMessage      = objGsmProtocol.GetFirstMessage()
  While( objGsmProtocol.LastError = 0 ) Then
    WScript.Echo "Received Message at: " & objSmsMessage.Time & " - " & objSmsMessage.TimeSecs
    Set objSmsMessage    = objGsmProtocol.GetNextMessage()
  WEnd
End If

SmsMessage.SMSC property

Type:

String

Applies to:

Gsm

Description:

Indicates the number of the provider that sent the message (only applies to messages that were sent through an SMSC provider). Only applies to incoming SMS messages via GSM or SMPP.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
...
objGsmProtocol.Receive()
If( objGsmProtocol.LastError = 0 ) Then
  Set objSmsMessage      = objGsmProtocol.GetFirstMessage()
  While( objGsmProtocol.LastError = 0 ) Then
    WScript.Echo "SMSC: " & objSmsMessage.SMSC
    Set objSmsMessage    = objGsmProtocol.GetNextMessage()
  WEnd
End If

SmsMessage.ServiceType property

Type:

String

Applies to:

Smpp

Description:

Some providers require that you set the type of SMS application for each message. By default, this property is an empty string.
You can assign the following values to the 'ServiceType' property:

  • "" - Empty string (default)
  • "CMT" - Cellular Messaging
  • "CPT" - Cellular Paging
  • "VMN" - Voice Mail Notification
  • "VMA" - Voice Mail Alerting
  • "WAP" - Wireless Application Protocol
  • "USSD" - Unstructured Supplementary Services Data
  • "CBS" - Cell Broadcast Service
  • "GUTS" - Generic UDP Transport Service

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "..."
objSmppProtocol.SystemID = "login"
objSmppProtocol.SystemPassword = "password
objSmppProtocol.SystemType = "..."
objSmppProtocol.Connect()
If objSmppProtocol.IsConnected = True Then
  objSmsMessage.ServiceType = "CMT"                                        ' Cellular Messaging
  objSmsMessage.Recipient = "+31624896641"                          
  objSmppProtocol.Send( objSmsMessage )                                    ' Send
  objSmppProtocol.Disconnect()                                             
End If

SmsMessage.PID
SmsMessage.DCS
SmsMessage.ESM properties

Type:

Number

Applies to:

Smpp

Description:

The 'PID', 'DCS' and 'ESM' properties apply to incoming SMS messages received via the SMPP protocol.
'PID' represents the SMPP 'protocol_id' parameter; 'DCS' represents the SMPP 'data_coding' parameter; 'ESM' represents the SMPP 'esm_class' parameter.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
...
objSmppProtocol.Receive()
If( objSmppProtocol.LastError = 0 ) Then
  Set objSmsMessage      = objSmppProtocol.GetFirstMessage()
  While( objSmppProtocol.LastErrror = 0 ) Then
    WScript.Echo "PID: " & objSmsMessage.PID
    WScript.Echo "DCS: " & objSmsMessage.DCS
    WScript.Echo "ESM: " & objSmsMessage.ESM
    Set objSmsMessage    = objSmppProtocol.GetNextMessage()
  WEnd
End If

SmsMessage.SourceTON
SmsMessage.SourceNPI
SmsMessage.DestinationTON
SmsMessage.DestinationNPI properties property

Type:

Number

Applies to:

Smpp

Description:

The 'SourceTON', 'SourceNPI', 'DestinationTON' and 'DestinationNPI' properties apply to outgoing SMPP SMS messages. 'SourceTON' and 'SourceTON' (Type of Numbering) indicate the type of SMS numbers to use during an SMPP session. If you use '0', the connection (session) value is used. Valid numbers are:

  • 0 - Default;
  • 1 - International;
  • 2 - National;
  • 3 - Network Specific;
  • 4 - Subscriber Number;
  • 5 - Alphanumeric;
  • 6 - Abbreviated.

'DestinationNPI' and 'DestinationNPI' (Numbering Plan Indicator) indicate which numbering plan to use during an SMPP session. If you use '0', the connection (session) value is used. Valid numbers are:

  • 0 - Default;
  • 1 - Telephone/ISDN (E163/E164);
  • 3 - Data (X.121);
  • 4 - Telex (F.69) ;
  • 6 - Land Mobile (E.212);
  • 8 - National;
  • 9 - Private.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
...
...
objSmsMessage.SourceTON  = 1
objSmsMessage.DestinationNPI = 1
objSmsMessage.Recipient  = "+4412345678"
strMessageReference = objSmppProtocol.Send( objSmsMessage )

6.4. SmsMessage Object - Functions

SmsMessage.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

  • None

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
...
objSmsMessage.Recipient  = "+4412345678"
objSmsMessage.Clear()
...

7. SmsProtocolGsm Object

7.1. SmsProtocolGsm Object - Introduction

The SmsProtocolGsm object enables sending and receiving of SMS messages using a GSM Modem or a modem-capable GSM phone.

The SmsProtocolGsm object communicates through a serial port, USB port, Bluetooth connection, infrared port or any Windows telephony compliant device.
It is recommended to use Windows 'Phone and Modem' devices, for example 'Standard 9600 bps Modem', or 'Nokia 6310i Phone'.
If a Windows telephony device is used, settings are controlled by the Windows telephony driver, and can be configured through the 'Phone and Modem' settings:

To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:

Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be setup properly before receiving messages:

You can send different types of SMS messages:

For more information about recommended GSM Modems, click here.
For a list of GSM phones tested with SMS and MMS Toolkit, click here.

Send a simple SMS message (via GSM Modem / GSM phone)

The following sample shows how to send an SMS message using a GSM modem (or modem-capable GSM phone):

Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+4412345678"                                   ' Recipient's mobile number 
objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text 
objSmsMessage.RequestDeliveryStatus = False                                ' No request for status report
objSmsMessage.ValidityPeriod = 0                                           ' Use GSM operator's default retry time

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.EnterPin ( "1234" )                                         ' SIM card's PIN code 
objGsmProtocol.Send( objSmsMessage )

If objGsmProtocol.LastError = 0 Then
  WScript.Echo "Message successfully delivered."
Else
  WScript.Echo "Error: " & objGsmProtocol.LastError
End If

NOTE: As an alternative, "Nokia 6310i Modem" can be replaced by "COM1", assuming that the Nokia phone is connected on COM1. However, the use of Windows telephony devices is recommended.

Receive SMS messages (via GSM Modem / GSM phone)

The following sample shows how to receive SMS messages using a GSM modem (or modem-capable GSM phone):

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
Set objConstants         = CreateObject( "ActiveXperts.SmsConstants" )

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.EnterPin( "1234" )                                          ' SIM card's PIN code 

objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage locations 

numMessages = objGsmProtocol.Receive()
If ( objGsmProtocol.LastError <> 0 ) Then 
  WScript.Quit
End If

For i = 0 to numMessages - 1
  On Error Resume Next
  Set objSmsMessage        = objGsmProtocol.GetMessage ( i )               ' Iterate over all received messages 
  On Error Goto 0

  If( objGsmProtocol.LastError = 0 ) Then
    WScript.Echo "Message from: " & objSmsMessage.Sender
    WScript.Echo "  " & objSmsMessage.Data
  End If
Next

objGsmProtocol.DeleteAllMessages ( 1 )                                     ' Delete all messages from phone or modem

7.2. SmsProtocolGsm Object - Overview of Properties and Functions

Type In/Out Mand/Opt Description
Version String Out n/a Product version number
ExpirationDate String Out n/a Product expiration date
Device String In/Out M Name of the device you want to use for receiving the SMS messages
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceFlowControl Number In/Out O Hardware flow control
DeviceInitString String In/Out O Initialization string for the device
MessageStorage Number In/Out O Preferred message storage
ReportsStorage Number In/Out O Preferred report storage
SMSC String In/Out O Preferred SMSC centre
LastError Number Out n/a Result of the last called function
LogFile String In/Out O All GSM commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
GetDeviceCount Return the number of Windows telephony devices installed on the local computer
GetDevice Retrieve a Windows telephony device name
EnterPin Enter pincode (required if SIM card is pin protected)
Send Send an SMS message
SendCommand Send a special command to the GSM device and read the response
QueryStatus Query message status
Receive Read all SMS messages from device storage
GetMessage Get the message at a specified index
DeleteMessage Delete the message at a specified index
DeleteAllMessages Delete all SMS messages
SaveReports Save all pending deliveryreports to disk
LoadReports Load all pending deliveryreports from disk
GetErrorDescription Lookup error description of the given error code

7.3. SmsProtocolGsm Object - Properties

SmsProtocolGsm.Version property

Type:

String

Description:

Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
WScript.Echo "Version: " & objGsmProtocol.Version

SmsProtocolGsm.ExpirationDate property

Type:

String

Description:

Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Once you have registered the product, the property holds the empty string value.

Example:

Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
WScript.Echo "ExpirationDate: " & objGsmProtocol.ExpirationDate

SmsProtocolGsm.Device property

Type:

String

Description:

The preferred device for sending and receiving SMS messages.
You can either use a Windows telephony device (recommended) or a physical COM port (directly).

Assign one of the following strings to the 'Device' property:

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Device    = "Standard 19200 bps Modem"                      ' Use a Windows telephony device (recommended)

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Device    = "COM2"                                          ' Use a COM port directly

SmsProtocolGsm.DeviceSpeed property

Type:

Number

Description:

By default, the speed settings are inherited from the Windows telephony device, or (in case a direct COM port is used) the default COM settings are used.
The default speed will usually suffice. Use 0 to use the default baudrate, or you any valid baudrate value like: 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, etc.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Device    = "Standard 19200 bps Modem"
objGsmProtocol.DeviceSpeed = 4800                                          ' To overwrite Windows telephony device speed

SmsProtocolGsm.DeviceFlowControl property

Type:

Number

Description:

Hardware flow control regulates communication between computer and device (usually a modem). There are two signals on the port for hardware flow control: DTR (Data Terminal Ready) and RTS (Request To Send). If you enable hardware flow control, computer and device will use both physical signals for flow control. It's very uncommon to change these values for modem communications. The 'DeviceFlowControl' will be ignored if the Device is a Windows telephony device, because flow control is already defined in the Windows telephony device properties (in the Windows Control Panel).
If a Windows telephony device is used (for instance: "Standard 19200 bps modem"), the 'DeviceFlowControl' property will be ignored because it is configured through the Control Panel.
For a list of flowcontrol values, click here.

Example:

Set objGsmProtocol      = CreateObject("ActiveXperts.SmsProtocolDialup")   ' Create SmsProtocolGsm instance
Set objSmsConstants     = CreateObject( "ActiveXperts.SmsConstants" )
objGsmProtocol.Device   = "COM2"
objGsmProtocol.DeviceFlowControl = objSmsConstants.asFLOWCONTROL_DISABLE   ' Disable hardware flow control

SmsProtocolGsm.DeviceInitString property

Type:

String

Description:

Initialization string for the GSM device. The following string is used to initialize a GSM device:

As mentioned above, the 'DeviceInitString' property is ignored if a Windows telephony device is used.
If you are using a direct port device, and you assign a string to the 'DeviceInitString' property, the string will be used to initialize the modem.
Important: commands can be separated by the ';' character, and will issued separately. So, if 'DeviceInitString' property holds the "ATZ" string, the toolkit first issues ATZ, waits for the OK response, then issues the AT&C1&K0 command and again waits for the OK response.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Device    = "COM1"
objGsmProtocol.DeviceInitString = "ATZ;AT&C1&K0"

SmsProtocolGsm.MessageStorage property

Type:

Number

Description:

By default, SMS messages are received from all available storage locations of a GSM modem. To specify a specific storage location, set the 'MessageStorage' property. Click here to see the list of GSM storage locations.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objGsmProtocol.Device    = "WaveCom Fastrack 1306B"
objGsmProtocol.MessageStorage = objSmsConstants.asSTORAGE_DEVICE           ' Use Device Storage only
...
objGsmProtocol.Receive
...

SmsProtocolGsm.ReportsStorage property

Type:

Number

Description:

This property is for advanced GSM modems only: if you need status reports for your outgoing SMS messages and you are dealing with an advanced GSM modem with a dedicated report memory location, you may need to specify a prefered storage for retrieving the status reports.
The storage location of status reports depends on the type of hardware: GSM phones usually store incoming delivery reports in their internal memory ONLY (don't use the 'ReportsStorage' property for these phones).
Again, please note that not all GSM devices support status reports.

Click here to see the list of GSM storage locations.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objGsmProtocol.Device    = "WaveCom Fastrack 1306B"
objGsmProtocol.ReportsStorage = objSmsConstants.asSTORAGE_REPORTS          ' Use special Reports memory instead of SIM
Set objDeliveryStatus    = objGsmProtocol.QueryStatus( "162" )

SmsProtocolGsm.SMSC property

Type:

String

Description:

By default, the SMSC address of your GSM provider is stored at the SIM card. If this provider is missing on the SIM card you will receive an error while sending messages. In this case, or when you want to set a different SMSC address you can use this property.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
....
objGsmProtocol.SMSC      = "+31624000000"                                  ' Set SMSC: +31624000000
....
objGsmProtocol.Send( .. )

SmsProtocolGsm.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Send( .. )
WScript.Echo "LastError: " & objGsmProtocol.LastError

SmsProtocolGsm.LogFile property

Type:

String

Description:

By default, LogFile holds the empty string so nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output data is written at the end of the file, the file is not cleared.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.LogFile   = "c:\temp\mylogfile.log"
objGsmProtocol.Send( .. )

7.4. SmsProtocolGsm Object - Functions

SmsProtocolGsm.Activate function

Description:

This function activates the SMS and MMS Toolkit product. A valid registration code should be passed as parameter.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully,

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.Activate "xxxxx-xxxxx-xxxxx", True ' Use a valid registration code
                                                  ' Pass True to make the activation persistent, so you need
                                                  ' to call Activate only once. If you pass False, you need to call Activate
                                                  ' each time the product is started.

SmsProtocolGsm.Clear function

Description:

This function resets all properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully,

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
...
objGsmProtocol.Send( .. )
...
objGsmProtocol.Clear()
...
objGsmProtocol.Send( .. )

SmsProtocolGsm.GetDeviceCount function

Description:

Returns the number of installed Windows telephony devices on the local computer.

Parameters:

Return value:

The number of installed Windows telephony devices. Check the LastError property to see if the function was completed successfully.

NOTE: The number of Windows telephony devices does not include the number of installed COM ports.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
WScript.Echo "Number of installed Windows telephony devices: " & objGsmProtocol.GetDeviceCount()

SmsProtocolGsm.GetDevice function

Description:

Returns the n-th telephony device of the system. The number n can be between 0 and GetDeviceCount()-1.

Parameters:

Return value:

The name of the device. Call the LastError function to see if the function was completed successfully.
The name of the device can be assigned to the Device property to open a Windows telephony device.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
n = objGsmProtocol.GetDeviceCount()
For i = 0 to n-1
   WScript.Echo "Device " & i & ": " & objGsmProtocol.GetDevice( i )
Next

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
If( objGsmProtocol.GetDeviceCount() > 0 )
   objGsmProtocol.Device = objGsmProtocol.GetDevice( 0 )                   ' Use the first telephony device
   Set objSmsMessage = objGsmProtocol.Receive()
End If

SmsProtocolGsm.EnterPin function

Description:

Enter the PIN code. Required for PIN protected SIM cards.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
objGsmProtocol.EnterPin( "1234" )                                          ' Use PIN code: 1234
....
objGsmProtocol.Send( .. )

SmsProtocolGsm.Send function

Description:

Send an SMS message via a GSM modem or GSM phone.

Parameters:

Return value:

A message reference string. If RequestDeliveryStatus is set, it can be used as a parameter in the QueryStatus function to check delivery of the SMS message.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+4412345678"                                   ' Recipient's mobile number 
objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text 
objSmsMessage.RequestDeliveryStatus = False                                ' No request for status report
objSmsMessage.ValidityPeriod = 0                                           ' Use GSM operator's default retry time

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.EnterPin ( "1234" )                                         ' SIM card's PIN code 
strMessageRef            = objGsmProtocol.Send( objSmsMessage )

If objGsmProtocol.LastError = 0 Then
  WScript.Echo "Message successfully delivered; Message reference: " & strMessageRef
Else
  WScript.Echo "Error: " & objGsmProtocol.LastError
End If

SmsProtocolGsm.SendCommand function

Description:

Send a special command to the GSM device, and read the response.
'SendCommand' is often used to check the signal strength of the device, but can also be used for other purposes.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+4412345678"                                   ' Recipient's mobile number 
objSmsMessage.Data       = "Hello, world!"                                 ' SMS message text 

objGsmProtocol.Device    = "COM1"

' Query the GSM modem for its signal strength
' The output (strCmdResponse) is something like "+CSQ: 30,0"
' where 30 indicates the signal strength (0 is lowest strength, 31 is highest),
' and 0 is an error code (0 means: no error)
strCmdResponse = objGsmProtocol.SendCommand( "AT+CSQ", 5000 )

' Split up the response and store it in arrCmdResponse
' arrCmdResponse(0): "+CSQ:"
' arrCmdResponse(1): "30,0"
arrCmdResponse = Split( strCmdResponse )

' Split up the string and store it in arrSignal
' arrSignal(0): "30"
' arrSignal(1): "1"
arrSignal = Split( arrCmdResponse(1), "," )

' Store Signal strenght [0..31] in numSignal as an Integer value
numSignal = CInt( arrSignal(0) )
WScript.Echo "Signal strength: " & numSignal

' If the signal strength is poor (less than 5) then quit
If( numSignal < 5 ) Then
   WScript.Echo "Singal strength too low."
   WScript.Quit
End If

objGsmProtocol.Send( objSmsMessage )

SmsProtocolGsm.QueryStatus function

Description:

Query the status of a message. Use the message reference that was returned by the Send function.
If the function completes successfully (i.e. if the LastError is 0 after the call), you can check the Status property to check the status of the message.

Parameters:

Return value:

An SmsDeliveryStatus object. Check LastError property to see if the function was completed successfully.

Example:

Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance
...
objSmsMessage.RequestDeliveryStatus = True
objSmsMessage.Recipient  = "+4412345678"
strMessageRef            = objGsmProtocol.Send( objSmsMessage )
...
If( objGsmProtocol.LastError = 0 ) Then
   WScript.Echo "MessageReference of last sent message: " & strMessageRef
   WScript.Sleep 20000                                                     ' Wait 20 ms for operator to deliver message
   Set objDeliveryStatus = objGsmProtocol.QueryStatus( strMessageRef )     ' Query status of message
   If( objGsmProtocol.LastError = 0 ) Then
     WScript.Echo "Status: " & objDeliveryStatus.Status
     WScript.Echo "Status description: " & objDeliveryStatus.StatusDescription
   End If
End If

SmsProtocolGsm.Receive function

Description:

Retrieve all incoming SMS messages (read and unread) from the device storage (i.e. SIM card and/or device memory).
Messages are queued internally by the Toolkit and can be fetched one-by-one by calling the GetFirstMessage and GetNextMessage functions. The number of received messages is indicated by the return value.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 

numMessages = objGsmProtocol.Receive()
...
For i = 0 to numMessages - 1
  On Error Resume Next
  Set objSmsMessage = objGsmProtocol.GetMessage ( i )
  On Error Goto 0
  
  If( objGsmProtocol.LastError = 0 ) 
    WScript.Echo "Message from: " & objSmsMessage.Sender
    WScript.Echo "  " & objSmsMessage.Data
  End If
Next

SmsProtocolGsm.GetMessage function

Description:

After a successfull call of the Receive function, you can retrieve the SMS messages one-by-one.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 
...
nCount = objGsmProtocol.Receive()                                          ' Receive and count messages 
...
For i = 0 To nCount - 1
  Set objSmsMessage = objGsmProtocol.GetMessage ( i )                      ' Retrieve message 

  WScript.Echo "Message from: " & objSmsMessage.Sender
  WScript.Echo "  " & objSmsMessage.Data
Next

SmsProtocolGsm.DeleteMessage function

Description:

After a successfull call of the Receive function, you can delete SMS messages one-by-one.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 
...
nCount = objGsmProtocol.Receive()                                          ' Receive and count messages 
...
For i = 0 To nCount - 1
  objGsmProtocol.DeleteMessage ( i )
Next

SmsProtocolGsm.DeleteAllMessages function

Description:

Delete all the received messages in the specified storage. When the parameters is set to 'False' only SMS messages are deleted. When set to 'True' also MMS notification messages will be deleted.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 
...
objGsmProtocol.Receive 
...
objGsmProtocol.DeleteAllMessages ( True )                                  ' Delete all messages 

SmsProtocolGsm.SaveReports function

Description:

Save all pending deliveryreports to a file. Using the LoadReports function, you can load the pending delivery reports to process them later, for instance after a system restart.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 
...
' Send some messages
...
objGsmProtocol.SaveReports ("c:\temp\reports.dat")                         ' Save pending reports to file 

SmsProtocolGsm.LoadReports function

Description:

Load pending deliveryreports from a file previously saved by using the SaveReports function.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objGsmProtocol.LoadReports ("c:\temp\reports.dat")

objGsmProtocol.Device    = "Nokia 6310i Modem"                             ' Use a Nokia Windows Telephony device 
objGsmProtocol.MessageStorage = objConstants.asSTORAGE_ALL                 ' Receive from any available storage location 
...

SmsProtocolGsm.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objGsmProtocol = CreateObject( "ActiveXperts.SmsProtocolGsm" )
objGsmProtocol.Send( .. )
If objGsmProtocol.LastError <> 0 Then
  WScript.Echo "Error description: " & objGsmProtocol.GetErrorDescription( objGsmProtocol.LastError )
End If

8. SmsProtocolHttp Object

8.1. SmsProtocolHttp Object - Introduction

With the HTTP interface you can send SMS messages directly from your business applications or websites in minutes. All you need is a subscription with a commercial HTTP-compliant SMS provider, and an internet connection.

You can send different types of SMS messages through HTTP:

Send SMS message through HTTP by using the SmsProtocolHttp object

The following sample shows how to deliver an SMS message through an HTTP-compliant SMS provider by using the SmsProtocolHttp object:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )

' Provider Settings
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Specify host
objHttpProtocol.ProviderPort = 8080                                        ' Specify port (default port:80)

' Provider Response templates
objHttpProtocol.ProviderErrorResponse = "ERR"                               ' Response should NOT contain 'ERR'
objHttpProtocol.ProviderSuccessResponse = "id"                              ' Response should contain 'id'

' URL Template
objHttpProtocol.URLText   = "/sendsms/default.asp?username=AX008&password=812056&text=%MESSAGEDATA%&to=" & _
                           "%MESSAGERECIPIENT%&from=%MESSAGESENDER%"

objHttpProtocol.Format    = objSmsConstants.asMESSAGEFORMAT_TEXT            ' Message Property: plain text

objSmsMessage.Data        = "Hello, world"                                  ' Message text
objSmsMessage.Sender      = "+31638740160"                                  ' Message sender   
objSmsMessage.Recipient   = "+3124896641"                                   ' Message recipient

objHttpProtocol.Send( objSmsMessage )                                       ' Send the message   
WScript.Echo "Send, result: " & objHttpProtocol.LastError

8.2. SmsProtocolHttp Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Version String Out n/a Product version number
Build String Out n/a Product build number
ExpirationDate String Out n/a Product expiration date - if any
ProviderHost String In/Out M Hostname or IP address of the SMS/HTTP provider
ProviderPort Number In/Out M TCP port used for connection to SMS/HTTP provider
ProviderUseSSL Boolean In/Out O Access the URL through SSL
ProviderSuccessResponse String In/Out M Specifies how a success response of the provider should look like
ProviderErrorResponse String In/Out M Specifies how an error response of the provider should look like
ProviderWebAccount String In/Out O Account name used for HTTP authentication
ProviderWebPassword String In/Out O Password used for HTTP authentication
ProxyServer String In/Out O Use a proxy server
ProxyAccount String In/Out O Use this account for proxy authentication
ProxyPassword String In/Out O Use this password for proxy authentication
ProxyPort Number In/Out O Use this TCP portnumber to connect to the proxyserver
URLText String In/Out M URL template for plain-text SMS messages
URLBinary String In/Out M URL template for binary SMS messages
URLUnicode String In/Out M URL template for Unicode SMS messages
LastError Number Out n/a Result of the last called function
ProviderResponse String Out n/a Response that was received after submitting the SMS/HTTP data
LogFile String In/Out O SMS/HTTP communication commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
Send Send the SMS message
GetErrorDescription Lookup error description of the given error code
ProviderLoadConfig Load the provider properties from a configuration file
ProviderSaveConfig Save the provider properties to a configuration file

8.3. SmsProtocolHttp Object - Properties

SmsProtocolHttp.Version property

Type:

String

Description:

Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
WScript.Echo "Version: " & objHttpProtocol.Version

SmsProtocolHttp.Build property

Type:

String

Description:

Build information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
WScript.Echo "Build: " & objHttpProtocol.Build

SmsProtocolHttp.ExpirationDate property

Type:

String

Description:

Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Once you have registered the product, the property holds the empty string value.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
WScript.Echo "ExpirationDate: " & objHttpProtocol.ExpirationDate

SmsProtocolHttp.ProviderHost property

Type:

String

Description:

Provider (host name or IP address) to connect to.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
...
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message

SmsProtocolHttp.ProviderPort property

Type:

Number

Description:

The TCP port of the SMS/HTTP provider. This property is optional, the default value is 80.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
objHttpProtocol.ProviderPort = 8080                                        ' Use port 8080 instead of default port 80
...
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message

SmsProtocolHttp.ProviderUseSSL property

Type:

Boolean

Description:

Set this property to indicate that the Send function must access the page through SSL. Send discards the 'http://' and 'https://' prefixes, so setting the 'ProviderUseSSL' property is the only way to tell the SmsProtocolHttp object to use SSL.

Example:

Set objHttpProtocol = CreateObject ( "ActiveXperts.SmsProtocolHttp" )      ' Create SmsProtocolHttp instance
objHttpProtocol.ProviderHost   = "post.activexperts-labs.com"              ' Host name of the SMS/HTTP provider
objHttpProtocol.ProviderUseSSL = True                                      ' Use SSL, i.e. https:// instead of http://
...
objHttpProtocol.Send( .. )                                                 ' Submit the SMS messageu using SSL

SmsProtocolHttp.ProviderSuccessResponse property

Type:

String

Description:

If the ProviderResponse propery matches this response, the completion code of Send will be 0 (which means: success). If the ProviderResponse matches ProviderErrorResponse, the completion code of Send will be asERR_ASMS_HTTPPOST_ERRORRESPONSE. If the ProviderResponse doesn't match ProviderSuccessResponse or ProviderErrorResponse, the completion code of Send will be asERR_ASMS_HTTPPOST_UNKNOWNRESPONSE.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )       ' Create a new SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
...
objHttpProtocol.ProviderErrorResponse = "ERR"                              ' If response matches 'ERR' then result is error
objHttpProtocol.ProviderSuccessResponse = "id"                             ' If response matches 'id' then result is success
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message
WScript.Echo "Send( .. ), result: " & objHttpProtocol.LastError            ' Display result
WScript.Echo "ProviderResponse: " & objHttpProtocol.ProviderResponse       ' Display provider response

SmsProtocolHttp.ProviderErrorResponse property

Type:

String

Description:

If the ProviderResponse propery matches this response, the completion code of Send will be 0 (which means: success).
If the ProviderResponse matches ProviderErrorResponse, the completion code of Send will be asERR_ASMS_HTTPPOST_ERRORRESPONSE.
If the ProviderResponse doesn't match ProviderSuccessResponse or ProviderErrorResponse, the completion code of Send will be asERR_ASMS_HTTPPOST_UNKNOWNRESPONSE.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )       ' Create a new SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
...
objHttpProtocol.ProviderErrorResponse = "ERR"                              ' If response matches 'ERR' then result is error
objHttpProtocol.ProviderSuccessResponse = "id"                             ' If response matches 'id' then result is success
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result
WScript.Echo "ProviderResponse: " & objHttpProtocol.ProviderResponse       ' Display provider response

SmsProtocolHttp.ProviderWebAccount property

Type:

String

Description:

Account name used for HTTP authentication with the provider.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )       ' Create a new SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
objHttpProtocol.ProviderWebAccount  = "mylogin"                            ' Account used to logon
objHttpProtocol.ProviderWebPassword = "mypasswd"                           ' Password used to logon
...
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message

SmsProtocolHttp.ProviderWebPassword property

Type:

String

Description:

Password used for HTTP authentication with the provider.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )       ' Create a new SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com"                ' Host name of the SMS/HTTP provider
objHttpProtocol.ProviderWebAccount  = "AX008"                              ' Account used to logon
objHttpProtocol.ProviderWebPassword = "812056"                             ' Password used to logon
...
objHttpProtocol.Send( .. )                                                 ' Submit the SMS message

SmsProtocolHttp.ProxyServer
ProxyAccount
ProxyPassword
ProxyPort properties

Type:

String

Description:

If your Internet configuration requires access through a proxy server, you must assign the host name or IP address of the proxy server to the 'ProxyServer' property. Optionally, if proxy authentication is required, assign the proxy authentication values to the 'ProxyAccount' and 'ProxyPassword' properties. The proxy properties are used by the Send function, so you must assign values to the proxy properties BEFORE calling the Send function.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )       ' Create a new SmsProtocolHttp instance
objHttpProtocol.ProviderHost   = "post.activexperts-labs.com"              ' Host name of the SMS/HTTP provider
objHttpProtocol.ProxyServer    = "proxy01.intranet.dom"                    ' Access through a proxy
objHttpProtocol.ProxyPort      = 8080                                      ' TCP port 8080
objHttpProtocol.ProxyAccount   = "mrjohnson"                               ' Proxy authentication required
objHttpProtocol.ProxyPassword  = "topsecret"                               ' Proxy authentication required
...
objHttp.Send

SmsProtocolHttp.URLText property

Type:

String

Description:

URL template used for submitting a plain-text SMS message. The format depends on the provider.
You can use the following placeholders:

Example:

Set objSmsMessage            = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
Set objHttpProtocol          = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
Set objSmsConstants          = CreateObject( "ActiveXperts.SmsConstants" )

objHttpProtocol.ProviderHost = "post.activexperts-labs.com" 
objHttpProtocol.URLText      = "/submit.asp?text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%"
objHttpProtocol.Format       = objSmsConstants.asMESSAGEFORMAT_TEXT

objSmsMessage.Data           = "Hello, world"
objSmsMessage.Sender         = "31638740160"
objSmsMessage.Recipient      = "+31625044454"
objHttpProtocol.Send( objSmsMessage )                                      ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result

SmsProtocolHttp.URLBinary property

Type:

String

Description:

URL template used for submitting a binary SMS message. The format depends on the provider.
You can use the following placeholders:

Example:

Set objSmsMessage         = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objHttpProtocol       = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
Set objSmsConstants       = CreateObject( "ActiveXperts.SmsConstants" )
...
objHttpProtocol.URLBinary = "/submit.asp?text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%"
objHttpProtocol.Format    = objSmsConstants.asMESSAGEFORMAT_DATA

objSmsMessage.Data        = "00FF202020FF"                                  ' Data string (stream of bytes, in hex)
objSmsMessage.Recipient   = "+31625044454"
objSmsMessage.Sender      = "+31638740160"
objHttpProtocol.Send( objSmsMessage )                                      ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result

SmsProtocolHttp.URLUnicode property

Type:

String

Description:

URL template used for submitting a Unicode SMS message. The format depends on the provider.
You can use the following placeholders:

Example:

Set objSmsMessage          = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
Set objHttpProtocol        = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
Set objSmsConstants        = CreateObject( "ActiveXperts.SmsConstants" )
objHttpProtocol.URLUnicode = "/submit.asp?text=%MESSAGEDATAHEX16%&to=%MESSAGERECIPIENT%&from=%MESSAGESENDER%"
...
objSmsMessage.Format       = objSmsConstants.asMESSAGEFORMAT_UNICODE
objSmsMessage.Data         = "ملحق خاصملحق خاص"                              ' Unicode message
objSmsMessage.Recipient    = "+31625044454"
objSmsMessage.Sender       = "+31638740160"

objHttpProtocol.Send( objSmsMessage )                                      ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result

SmsProtocolHttp.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
...
objHttpProtocol.Send( .. )
WScript.Echo "LastError: " & objHttpProtocol.LastError

SmsProtocolHttp.ProviderResponse property

Type:

String

Description:

The response that was received after the SMS/HTTP message was submitted. You can use this property to determine the result of the submission.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage")        ' Create SmsMessage instance
Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
objHttpProtocol.ProviderHost = "post.activexperts-labs.com" 
...
objHttpProtocol.Recipient( "+31625044454" )
objHttpProtocol.Send( objSmsMessage )                                      ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result
WScript.Echo "ProviderResponse: " & objHttpProtocol.ProviderResponse       ' Display result

SmsProtocolHttp.LogFile property

Type:

String

Description:

By default, 'LogFile' holds an empty string and - as a result - nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output data is written at the end of the file, the file is not cleared.

Example:

Set objHttpProtocol      = CreateObject( "ActiveXperts.SmsProtocolHttp" )  ' Create SmsProtocolHttp instance
objHttpProtocol.LogFile  = "c:\temp\mylogfile.log"
...
objHttpProtocol.Send

8.4. SmsProtocolHttp Object - Functions

SmsProtocolHttp.Activate function

Description:

This function activates the SMS and MMS Toolkit product. A valid registration code should be passed as parameter.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )
objHttpProtocol.Activate "xxxxx-xxxxx-xxxxx", True   ' Use a valid registration code
                                                     ' Pass True to make the activation persistent, so you need to call
                                                     ' Activate only once. If you pass False, you need to call Activate 
                                                     ' each time the product is started.

SmsProtocolHttp.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )
...
objHttpProtocol.Send( .. )
objHttpProtocol.Clear()
...
objHttpProtocol.Send( .. )
objHttpProtocol.Clear()

SmsProtocolHttp.Send function

Description:

Connects to the Provider on a specific Port and submits the URLText (or URLBinary or URLUnicode) URL. Check the LastError for the result.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully

Example:

Set objSmsMessage            = CreateObject("ActiveXperts.SmsMessage")     ' Create SmsMessage instance
Set objHttpProtocol          = CreateObject("ActiveXperts.SmsProtocolHttp")' Create SmsProtocolHttp instance
...
objSmsMessage.Format         = objSmsConstants.asMESSAGEFORMAT_TEXT
objSmsMessage.Data           = "Hello, world"
objSmsMessage.Recipient      = "+31625044454"
...
objHttpProtocol.ProviderHost = "post.activexperts-labs.com" 
objHttpProtocol.URLText      = "/submit.asp?username=joe&password=805&text=%MESSAGEDATA%&to=%MESSAGERECIPIENT%"
objHttpProtocol.Send( objSmsMessage )                                      ' Submit the SMS message
WScript.Echo "Send, result: " & objHttpProtocol.LastError                  ' Display result

SmsProtocolHttp.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code

Parameters:

Return value:

The error string.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )
...
objHttpProtocol.Send( .. )
If objHttpProtocol.LastError <> 0 Then
  WScript.Echo "Error description: " & objHttpProtocol.GetErrorDescription( objHttpProtocol.LastError )
End If

SmsProtocolHttp.ProviderLoadConfig function

Description:

Load provider specific information from an HTTP configuration file.

ActiveXperts SMS and MMS Toolkit ships with various configuration files (extension: '.http') for different providers. Each configuration file contains HTTP provider specific information. The 'ProviderLoadConfig' function loads the following properties:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )
Set objSmsMessage   = CreateObject( "ActiveXperts.SmsMessage")             ' Create SmsMessage instance

objHttpProtocol.ProviderLoadConfig( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Http\ActiveXperts.http" )
...
objSmsMessage.Recipient = "+31612345678"
objSmsMessage.Data  = "Hello World!!!"
...
objHttpProtocol.Send( objSmsMessage )
If objHttpProtocol.LastError <> 0 Then
  WScript.Echo "Error description: " & objHttpProtocol.GetErrorDescription( objHttpProtocol.LastError )
End If

SmsProtocolHttp.ProviderSaveConfig function

Description:

Save provider specific information to an HTTP configuration file.

You can save the following properties into an HTTP file:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objHttpProtocol = CreateObject( "ActiveXperts.SmsProtocolHttp" )
...
objHttpProtocol.ProviderHost = "http://post.activexperts-labs.com"
objHttpProtocol.ProviderPort = 8080
...
objHttpProtocol.ProviderSaveConfig ( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Http\MyProvider.http" )

9. SmsProtocolSmpp Object

9.1. SmsProtocolSmpp Object - Introduction

The SmsProtocolSmpp object enables high-volume and corporate SMS messaging. To use SMPP, you must subscribe to an SMPP provider first. For testing purposes, you can make use of the ActiveXperts SMPP gateway (smpp.activexperts-labs.com).

The SmsProtocolSmpp object allows you to connect to the remote SMPP-compliant SMSC provider using the SMPP network protocol. SMPP ('Short Message Peer-to-Peer') is a Layer-7 TCP/IP protocol. SMPP enables high-volumes incoming and outgoing SMS messaging, usually 10 SMS messages per second or more. Messages can be 'acknowledged', which means that delivery can be guaranteed.

The SmsProtocolSmpp object can be used to send and receive SMS messages in high volumes.

The SmsProtocolSmpp object supports both v.3.3 and v.3.4 of SMPP.

You can send different types of SMS messages:

Send SMS message through SMPP by using the SmsProtocolSmpp object

The following sample shows how to deliver an SMS message through an SMPP-compliant SMSC provider by using the SmsProtocolSmpp object:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server         = "smpp.activexperts-labs.com"              ' Set SMPP host
objSmppProtocol.ServerPort     = 2775                                      ' Set SMPP TCP port
objSmppProtocol.SystemID       = "AX005"                                   ' Set SMPP system ID / login
objSmppProtocol.SystemPassword = "812056"                                  ' Set SMPP password

objSmppProtocol.Connect                                                    ' Establish a TCP/IP based SMPP session
If objSmppProtocol.IsConnected = True Then
  objSmsMessage.Recipient = "+31612345678"                                 ' Set message recipient SMS number
  objSmsMessage.Data      = "Hello World via SMPP"                         ' Set message text
  objSmppProtocol.Send( objSmsMessage )                                    ' Send
  If( objSmppProtocol.LastError <> 0 ) Then
    WScript.Echo "Failed to send message, error: " & objSmppProtocol.LastError 
  Else
    WScript.Echo "Message successfully submitted" 
  End If

  objSmppProtocol.Disconnect
End If
Receive SMS messages through SMPP by using the SmsProtocolSmpp object

The following sample shows how to receive SMS messages through an SMPP-compliant SMSC provider by using the SmsProtocolSmpp object:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server         = "smpp.activexperts-labs.com"              ' Set SMPP host
objSmppProtocol.ServerPort     = 2775                                      ' Set SMPP TCP port
objSmppProtocol.SystemID       = "AX005"                                   ' Set SMPP login
objSmppProtocol.SystemPassword = "812056"                                  ' Set SMPP password

objSmppProtocol.Connect                                                    ' Establish a TCP/IP based SMPP session
If objSmppProtocol.IsConnected = True Then
  
  numMessages = objSmppProtocol.CountReceivedMessages ()
  
  For i = 0 To numMessages - 1                                             ' Receive messages one by one
    On Error Resume Next
    Set objSmsMessage = objSmppProtocol.GetMessage ( i )
    On Error Goto 0
    
    If ( objSmppProtocol.LastError = 0 ) Then
      WScript.Echo "Message Received"
      WScript.Echo "  Sender:  " & objSmsMessage.Sender
      WScript.Echo "  Message: " & objSmsMessage.Data
    End If
  Next
    
  objSmppProtocol.Disconnect
End If

9.2. SmsProtocolSmpp Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Version String Out n/a Product version number
Build String Out n/a Product build number
ExpirationDate String Out n/a Product expiration date - if any
Server String In/Out M Hostname or IP address of the SMPP provider
ServerPort Number In/Out M TCP port used for connection to SMPP provider
ServerTimeout Number In/Out O Server timeout in milliseconds, used for all network operations
ServerKeepAlive Number In/Out O Keep alive time in seconds, to keep a communication channel open
SystemVersion Number In/Out O Specify version of your SMPP provider
SystemID String In/Out M Account used to login to the SMPP provider's system
SystemPassword String In/Out M Password used to login to the SMPP provider's system
SystemType String In/Out O Type of SMSC provider. Default: "SMPP"
SystemCharSet Number In/Out O Selected character set
SystemSourceAddress String In/Out O The SMS mobile number associated with your SMPP account. Only used for outgoing messages to indicate the sender
SystemSourceTON Number In/Out O SMPP client's TON (Type Of Number) used during SMPP server session
SystemSourceNPI Number In/Out O SMPP client's NPI (Numbering Plan Indicator) used during SMPP server session
SystemDestinationTON Number In/Out O SMPP server's TON (Type Of Number) used during SMPP server session
SystemDestinationNPI Number In/Out O SMPP server's NPI (Numbering Plan Indicator) used during SMPP server session
SystemThroughput Number In/Out O Limits the number of messages per second
IsConnected Boolean Out n/a Indicates if a connection to the remote SMPP provider is still established
DeliveryReportFormat Number In/Out O Sets the format of the deliveryreports returned by the provider
LastError Number Out n/a Result of the last called function
LogFile String In/Out O SMPP communication commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
Connect Establish an SMPP connection to the remote SMPP provider. Based on TCP/IP
Disconnect Disconnect current SMPP connection
SetTLVValue Set a TLV (Type/Length/Value) item
GetTLVValue Retrieve a TLV (Type/Length/Value) item
Send Send an SMS message
QueryStatus Query message status of an outgoing message
SaveReports Save pending deliveryreports to a file
LoadReports Load pending deliveryreports from a file
CountReceivedMessages Count number of incoming messages from buffer
GetMessage Retrieve incoming message from buffer
GetErrorDescription Lookup error description of the given error code
ProviderLoadConfig Load the provider properties from a configuration file
ProviderSaveConfig Save the provider properties to a configuration file

9.3. SmsProtocolSmpp Object - Properties

SmsProtocolSmpp.Version property

Type:

String

Description:

Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
WScript.Echo "Version: " & objSmppProtocol.Version

SmsProtocolSmpp.Build property

Type:

String

Description:

Build information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
WScript.Echo "Build: " & objSmppProtocol.Build

SmsProtocolSmpp.ExpirationDate property

Type:

String

Description:

Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
WScript.Echo "ExpirationDate: " & objSmppProtocol.ExpirationDate

SmsProtocol.SmppServer property

Type:

String

Description:

Sets the hostname or TCP/IP address of the SMPP server provider.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
...
objSmppProtocol.Connect()                                                  ' Connect to the remote SMPP provider

SmsProtocolSmpp.ServerPort property

Type:

Number

Description:

Sets the TCP port for SMPP connection. This property is optional, the default value is 2775.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
...
objSmppProtocol.Connect()                                                  ' Connect to the remote SMPP provider

SmsProtocolSmpp.ServerTimeOut property

Type:

Number

Description:

Maximum time (in milliseconds) before a Connect, Send or QueryStatus operation will timeout. Default value: 10000 milliseconds.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.ServerTimeout = 4000                                       ' 4000 milliseconds before an operation times out
...
objSmppProtocol.Connect()                                                  ' Connect to the remote SMPP provider

SmsProtocolSmpp.ServerKeepAlive property

Type:

String

Description:

The 'ServerKeepAlive' value is used to keep the current SMPP session alive. It is a good practise to keep a session opened until you don't want to send SMS messages anymore. You can keep the session open for hours, or for days, or even longer.
Some providers don't accept a connect/disconnect for each bunch of SMS messages; they require the session to remain opened until you have completed sending your messages.

The default value is 30 seconds, which means that the SMS and MMS Toolkit sends an 'alive' packet to the remote SMPP server to tell that the session must be remained open.
It is recommended to use 30 seconds, unless your connection drops within 60 seconds; you should then decrease this value.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.ServerKeepAlive = 30                                       ' 30 seconds before the session times out
...
objSmppProtocol.Connect()                                                  ' Connect to the remote SMPP provider

SmsProtocolSmpp.SystemVersion property

Type:

Number

Description:

The 'SystemVersion' value makes sure that both parties (i.e. the ActiveXperts SMS and MMS Toolkit and the SMPP provider) communicate using the same protocol.

Most providers support v 3.3 or higher. By default, ActiveXperts SMS and MMS Toolkit communicates using the SMPP v 3.4 specifications. Use can assign one of the following values: asSMPPVERSION_33, asSMPPVERSION_34 or asSMPPVERSION_50.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.SystemVersion = objSmppProtocol.asSMPPVERSION_33           ' Remote SMPP provider operates in v 3.3 mode
...
objSmppProtocol.Connect()                                                  ' Connect to the remote SMPP provider

SmsProtocolSmpp.SystemID property

Type:

String

Description:

Account information that is required to logon to the remote SMPP-compliant SMSC provider. After you sign up with such an SMSC provider, the provider provides you with a valid 'SystemID' and SystemPassword.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.SystemID = "AX005"                                         ' Login
objSmppProtocol.SystemPassword = "812056"                                  ' Password
...
objSmppProtocol.Connect()

SmsProtocolSmpp.SystemPassword property

Type:

String

Description:

Account information that is required to logon to the remote SMPP-compliant SMSC provider. After you sign up with such an SMSC provider, the provider provides you with a valid SystemID and 'SystemPassword'.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.SystemID = "AX005"                                         ' Login
objSmppProtocol.SystemPassword = "812056"                                  ' Password
...
objSmppProtocol.Connect()

SmsProtocolSmpp.SystemType property

Type:

String

Description:

Some valid values are: "SMPP", "VMS", "OTA" or an empty string. Ask your SMPP provider which value to use.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.activexperts-labs.com"                    ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 2775                                          ' TCP port number
objSmppProtocol.SystemID = "AX005"                                         ' Login
objSmppProtocol.SystemPassword = "812056"                                  ' Password
objSmppProtocol.SystemType  = "SMPP"                                       ' System Type
...
objSmppProtocol.Connect()

SmsProtocolSmpp.SystemCharSet property

Type:

Number

Description:

Selected character set. You should leave this property to its default asSMPPCHARSET_DEFAULT, unless special characters (like @[]�^~{}|) are not displayed properly.
You should set the property before you connect to your SMPP SMSC provider.
For a list of valid Character Set values, click here.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
objSmppProtocol.SystemCharSet = objSmsConstants.asSMPPCHARSET_GSM          ' Change character set
objSmppProtocol.Connect()
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.SystemSourceAddress property

Type:

String

Description:

Your SMS number, associated with your SMPP provider account.
Usually it is not necessary to set this value, because your SMS number is automatically displayed on the recipient's mobile phone.
However, if you want to use an alphanumeric display name on the recipient's mobile home, you must set this property. When using alphanumeric display names, it is also recommended to set the SystemSourceTON to 5 (not required by all providers, but highly recommended).

Also, if you have multiple SMS numbers reserved at your SMPP providers for different purposes, you may want to indicate the right orginator SMS address when sending SMS messages. You can also specify an alpha-numeric source address up to 11 characters. This feature is not supported by all SMPP providers.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.SystemSourceAddress = "+447797882390"                      ' ActiveXperts' virtual SMS number at HSL Systems
...
objSmsMessage.Data = "Hello, world!"                   
objSmsMessage.Recipient = "+31624896641"              
...
objSmppProtocol.Send( objSmsMessage )

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.SystemSourceAddress = "ActiveXperts"                       ' ActiveXperts will be displayed on the phone
objSmppProtocol.SystemSourceTON = 5                                        ' Set SystemSourceTON on alphanumeric sender
...
objSmsMessage.Data       = "Hello, world!"                   
objSmsMessage.Recipient  = "+31624896641"              
...
objSmppProtocol.Connect()
...
objSmppProtocol.Send( objSmsMessage )
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.SystemSourceTON
SystemSourceNPI
SystemDestinationNPI
SystemDestinationNPI properties

Type:

Number

Description:

'SystemSourceTON' and 'SystemDestinationTON' (Type of Number) indicate the type of SMS numbers to use during an SMPP session. Usually, the default value (0, auto-detect) will suffice. If you want to use a different value, you must set it before you call the Connect function.

Valid numbers are:

'SystemSourceNPI' and 'SystemDestinationNPI' (Numbering Plan Indicator) indicate which numbering plan to use during an SMPP session. Usually, the default value (0, auto-detect) will suffice. If you want to use a different value, you must set it before you call the Connect function. Valid numbers are:

For more information about Type of Numbering (TON) and Numbering Plan Indicator (NPI), click here: www.activexperts.com/support/xmstoolkit/tonnpi.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.SystemSourceTON = 1                                        ' Force International Number format
objSmppProtocol.SystemDestinationTON = 1                                   ' Force International Number format
objSmppProtocol.SystemSourceNPI = 1                                        ' Force Telephone/ISDN
objSmppProtocol.SystemDestinationNPI = 1                                   ' Force Telephone/ISDN
objSmppProtocol.Connect()
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.SystemThroughput property

Type:

Number

Description:

Limits the number of messages per second. Default value is 0, which means: unlimited.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.Connect()
...
objSmppProtocol.SystemThroughput = 5                                       ' Max. 5 messages per second
...
For i = 1 To x
   ...
   objSmppProtocol.Send( objSmsMessage )
Next
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.DeliveryReportFormat property

Type:

Number

Description:

Sets the delivery report format used by the provider. There are 2 formats:

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants")      ' Create SmsConstants instance
...
objSmppProtocol.Connect()
...
objSmppProtocol.SystemThroughput = 5                                       ' Max. 5 messages per second
...
For i = 1 To x
   ...
   objSmppProtocol.Send( objSmsMessage )
Next
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.IsConnected property

Type:

String

Description:

Indicates whether a connection to a remote SMPP server is still established or not.
Use it when you have previously connected to the remote SMPP provider. If the connection is still established, 'IsConnected' will be True, otherwise it will be False.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
If( objSmppProtocol.IsConnected = False ) Then
  objSmppProtocol.Connect()
End If
...
objSmppProtocol.Send( objSmsMessage )
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Connect()
WScript.Echo "LastError: " & objSmppProtocol.LastError

SmsProtocolSmpp.LogFile property

Type:

String

Description:

By default, 'LogFile' holds an empty string and - as a result - nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output data is written at the end of the file, the file is not cleared.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.LogFile  = "c:\temp\mylogfile.log"
objSmppProtocol.Connect()
...

9.4. SmsProtocolSmpp Object - Functions

SmsProtocolSmpp.Activate function

Description:

This function activates the SMS and MMS Toolkit product. A valid registration code should be passed as parameter.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Activate "xxxxx-xxxxx-xxxxx", True   ' Use a valid registration code
                                                     ' Pass True to make the activation persistent, so you need to call
                                                     ' Activate only once. If you pass False, you need to call Activate 
                                                     ' each time the product is started.

SmsProtocolSmpp.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.Connect( .. )

objSmppProtocol.Send( .. )
objSmppProtocol.Clear()
...
objSmppProtocol.Send( .. )
...
objSmppProtocol.Disconnect()

SmsProtocolSmpp.Connect function

Description:

Establish an SMPP connection to the remote SMPP-compliant SMSC provider. Based on TCP/IP.
If you already connected to the SMPP provider, you can simply check if the connection is still established by checking the IsConnected property.
You must first sign-up with an SMPP-compliant SMSC provider before you can connect to it. The function requires a Server and ServerPort specification, as well as a valid SystemID and SystemPassword to log on.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.Server   = "smpp.yoursmppprovider.com"                     ' DNS name of the remote SMPP provider
objSmppProtocol.ServerPort = 8011                                          ' TCP port number
objSmppProtocol.SystemID = "yourlogin"                                     ' SystemID provided by the SMSC provider
objSmppProtocol.SystemPassword = "yourpassword"                            ' Password provided by the SMSC provider
...
If( objSmppProtocol.IsConnected = False )
  objSmppProtocol.Connect()                                                ' Connect to the remote SMPP provider
End If

SmsProtocolSmpp.Disconnect function

Description:

Disconnect a connection that was established by the Connect function.
You can call 'Disconnect' even when there is no connection, to make sure the session gets disconnected.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
If( objSmppProtocol.IsConnected = True )
  objSmppProtocol.Disconnect() 
End If

SmsProtocolSmpp.SetTLVValue function

Description:

Use this function to set a TLV to a specific value and send it with every message. This function can be called after a connection to the SMPP server has been established. TLV values can be cleared by calling the Clear function.

When this function is called before the Send function, the TLV will be associated with the message to be send.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmsMessage.Data       = "Hello, world!"                   
objSmsMessage.Recipient  = "+31624896641"     
...        
objSmppProtocol.SetTLVValue objSmsConstants.asSMPP_TLV_2BYTE,  &H1400, 2          ' Numeric data
objSmppProtocol.SetTLVValue objSmsConstants.asSMPP_TLV_COCTET, &H1401, "BM_PROD"  ' String data
objSmppProtocol.SetTLVValue objSmsConstants.asSMPP_TLV_1BYTE,  &H1402, True       ' Boolean data
...
objSmppProtocol.Send( .. )

SmsProtocolSmpp.GetTLVValue function

Description:

Use this function to retrieve a TLV associated with the last retrieved message using the GetMessage, GetFistMessage and GetNextMessage functions. This function can be called after a connection to the SMPP server has been established. TLV values can be cleared by calling the Clear function.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtcol.GetFirstMessage               
...        
WScript.Echo objSmppProtocol.GetTLVValue &H1400                            ' Retrieve TLV 0x1400 value

SmsProtocolSmpp.Send function

Description:

Send an SMS message. The contents of the message is indicated by the SmsMessage::Data and SmsMessage::Format properties.
You must first connect to the SMPP provider before you actually send the message.

Parameters:

Return value:

A message reference string. If RequestDeliveryStatus is set, it can be used as a parameter by the QueryStatus function to check delivery of the SMS message.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server   = "smpp.activexperts.com"
objSmppProtocol.ServerPort =  8011
objSmppProtocol.SystemID = "8888sdsad"
objSmppProtocol.SystemPassword = "add34dfa8"
objSmppProtocol.SystemType = "SMPP"
objSmppProtocol.Connect

If objSmppProtocol.IsConnected = True Then

  objSmsMessage.Data     = "Hello, world (1)"
  objSmsMessage.Recipient= "+31624896641"
  strMessageRef          = objSmppProtocol.Send( objSmsMessage )           ' Send a message
  If( objSmppProtocol.LastError = 0 )
	WScript.Echo "MessageReference: " & strMessageRef
  End If

  objSmsMessage.Data     = "Hello, world (2)"
  objSmsMessage.Recipient= "+3162910877"
  strMessageRef          = objSmppProtocol.Send( objSmsMessage )           ' Send a message
  If( objSmppProtocol.LastError = 0 )
	WScript.Echo "MessageReference: " & strMessageRef
  End If

  objSmppProtocol.Disconnect                                               ' Disconnect
End if

SmsProtocolSmpp.QueryStatus function

Description:

Query the status of a message. Use a message reference that was returned by the Send function; if this function completes successfully (i.e. if the LastError is 0 after the call), you can check the Status property to check the status of the message.

Note that the QueryStatus function can be used synchronous (2nd parameter: True) or asynchrous (second parameter: False). To optimize throughput for bulk SMS messaging, you should always use the QueryStatus function asynchronous (i.e., 2nd parameter set to False). In synchronous mode, the function waits for the message to get into its final state. This is easier from programming point of view, but reduces performance. To improve performance, it is better to call the Send function multiple times, storing the message references, and check them later (asynchronous).

Parameters:

Return value:

An SmsDeliveryStatus object. Check LastError property to see if the function was completed successfully. Expected LastError values are: 0 (for success), asERR_AXMS_SMPP_TIMEOUT when the function times out, asERR_AXMS_SMS_INVALIDMESSAGEREFERENCE when the first parameter is invalid, or asERR_AXMS_SMPP_NOTBOUND when there's no connection.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server   = "smpp.activexperts.com"
objSmppProtocol.ServerPort =  8011
objSmppProtocol.SystemID = "8888sdsad"
objSmppProtocol.SystemPassword = "add34dfa8"
objSmppProtocol.SystemType = "SMPP"

objSmppProtocol.Connect
If objSmppProtocol.IsConnected = True Then
   ...
   strMessageRef         = objSmpp.Send( objMessage )
   ...
   Set objDeliveryStatus = objSmppProtocol.QueryStatus( strMessageRef, True ) ' Query status of message, synchronous
   If( objSmppProtocol.LastError = 0 ) Then
	 WScript.Echo "Status: " & objDeliveryStatus.Status
	 WScript.Echo "Status description: " & objDeliveryStatus.StatusDescription
   End If
  objSmppProtocol.Disconnect        ' Disconnect 
End if

SmsProtocolSmpp.SaveReports function

Description:

Save all pending deliveryreports to a file. Using the LoadReports function, you can load the pending delivery reports to process them later, for instance after a system restart.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server   = "smpp.activexperts.com"
objSmppProtocol.ServerPort =  8011
objSmppProtocol.SystemID = "8888sdsad"
objSmppProtocol.SystemPassword = "add34dfa8"
objSmppProtocol.SystemType = "SMPP"

objSmppProtocol.Connect
If objSmppProtocol.IsConnected = True Then
   ...
   strMessageRef         = objSmpp.Send( objMessage )
   ...
   Set objDeliveryStatus = objSmppProtocol.QueryStatus( strMessageRef, False ) ' Query status of message, asynchronous
   If( objSmppProtocol.LastError = 0 ) Then
	 WScript.Echo "Status: " & objDeliveryStatus.Status
	 WScript.Echo "Status description: " & objDeliveryStatus.StatusDescription
   End If
objSmppProtocol.Disconnect        ' Disconnect 
...
objSmppProtocol.SaveReports ("c:\temp\reports.dat")                           ' Save pending reports to file 

SmsProtocolSmpp.LoadReports function

Description:

Load pending deliveryreports from a file previously saved by using the SaveReports function.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.LoadReports ("c:\temp\reports.dat")                        ' Save pending reports to file 

objSmppProtocol.Server         = "smpp.activexperts.com"
objSmppProtocol.ServerPort     =  8011
objSmppProtocol.SystemID       = "8888sdsad"
objSmppProtocol.SystemPassword = "add34dfa8"

objSmppProtocol.Connect
If objSmppProtocol.IsConnected = True Then
   ...
   strMessageRef         = objSmpp.Send( objMessage )
   ...
   Set objDeliveryStatus = objSmppProtocol.QueryStatus( strMessageRef, False ) ' Query status of message, asynchronous
   If( objSmppProtocol.LastError = 0 ) Then
	 WScript.Echo "Status: " & objDeliveryStatus.Status
	 WScript.Echo "Status description: " & objDeliveryStatus.StatusDescription
   End If
objSmppProtocol.Disconnect        ' Disconnect 
...

SmsProtocolSmpp.CountReceivedMessages function

Description:

Use the 'CountReceivedMessages' function to retrieve the number of received messages currently in the buffer.
Use GetMessage function to receive the messages one-by-one.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server         = "smpp.activexperts-labs.com"                    
objSmppProtocol.ServerPort     = 2775                                           
objSmppProtocol.SystemID       = "AX005"                                         
objSmppProtocol.SystemPassword = "812056"                                  

objSmppProtocol.Connect                                                    ' Establish SMPP session
If objSmppProtocol.IsConnected = True Then
  numMessages = objSmppProtocol.CountReceivedMessages
  
  For i = 0 to numMessages - 1
	On Error Resume Next
	Set objSmsMessage = objSmppProtocol.GetMessage ( i )
	On Error Goto 0
	
	If ( objSmppProtocol.LastError = 0 ) Then
	  WScript.Echo "Message Received"
	  WScript.Echo "  Sender: " & objSmsMessage.Sender
	  WScript.Echo "  Message: " & objSmsMessage.Data
	End If
  Next
  
  objSmppProtocol.Disconnect                                               ' Disconnect from SMPP session
End If

SmsProtocolSmpp.GetMessage function

Description:

Use the 'GetMessage' function to retrieve incoming messages - one by one - from the SMPP provider.
Use CountReceivedMessages to get the number of SMS messages waiting in the buffer.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance

objSmppProtocol.Server         = "smpp.activexperts-labs.com"                    
objSmppProtocol.ServerPort     = 2775                                           
objSmppProtocol.SystemID       = "AX005"                                         
objSmppProtocol.SystemPassword = "812056"                                  

objSmppProtocol.Connect                                                    ' Establish SMPP session
If objSmppProtocol.IsConnected = True Then
  numMessages = objSmppProtocol.CountReceivedMessages
  
  For i = 0 to numMessages - 1
    On Error Resume Next
    Set objSmsMessage = objSmppProtocol.GetMessage ( i )
    On Error Goto 0
    
    If ( objSmppProtocol.LastError = 0 ) Then
      WScript.Echo "Message Received"
      WScript.Echo "  Sender: " & objSmsMessage.Sender
      WScript.Echo "  Message: " & objSmsMessage.Data
    End If
  Next
  
  objSmppProtocol.Disconnect                                               ' Disconnect from SMPP session
End If

SmsProtocolSmpp.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.Send( .. )
If objSmppProtocol.LastError <> 0 Then
  WScript.Echo "Error description: " & objSmppProtocol.GetErrorDescription( objSmppProtocol.LastError )
End If<

SmsProtocolSmpp.ProviderLoadConfig function

Description:

Load provider specific information from an SMPP configuration file.

ActiveXperts SMS and MMS Toolkit ships with various configuration files for different providers. Each configuration file contains SMPP provider specific information. The 'ProviderLoadConfig' function loads the following properties:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
objSmppProtocol.ProviderLoadConfig ( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Smpp\ActiveXperts.smpp" )
...
objSmppProtocol.Connect
...

SmsProtocolSmpp.ProviderSaveConfig function

Description:

Save provider specific information to an SMPP configuration file.

You can save the following properties into an SMPP file:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSmppProtocol      = CreateObject( "ActiveXperts.SmsProtocolSmpp" )  ' Create SmsProtocolSmpp instance
...
objSmppProtocol.ProviderHost = "smpp.activexperts-labs.com"
objSmppProtocol.ProviderPort = 2775
objSmppProtocol.SystemID = "AX008"
objSmppProtocol.SystemPassword = "812056"
...
objSmppProtocol.ProviderSaveConfig ( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Smpp\MyProvider.smpp" )

10. SmsProtocolDialup Object

10.1. SmsProtocolDialup Object - Introduction

The SmsProtocolDialup object enables you to send SMS messages using a normal Hayes compatible modem (1200 bps or higher). The modem connects to an SMSC dial-in Service Provider to deliver the SMS message.
You can use the SmsProtocolDialup object to send SMS messages; receiving messages is not supported by the nature of SMSC Service Providers.
The SmsProtocolDialup object can only send messages one-by-one.

There are many SMSC dial-in service providers around the world; click here for a list of supported SMS providers.

The SmsProtocolDialup object communicates with a normal modem using either a direct COM port, or using a Windows telephony device.
It is recommended to use Windows telephony devices, for instance 'Standard 9600 bps Modem'.
If a Windows telephony device is used, settings are controlled by the Windows telephony driver, and can be configured through the 'Phone and Modem' settings:

To select a 'Phone and Modem' device in the toolkit's object, assign an existing telephony name to the Device property:

Alternatively, you can use a port directly, for instance: 'COM1'. As a result, device properties must be configured properly before sending messages:

You can set the Sender address to indicate the originator of the message. (this is different from the SmsProtocolGsm object, where the Sender address is inherited from the SIM card and - as a result - cannot be overwritten). To set the Sender address, assign the following property:

To indicate the Recipient of the message, you must set the 'Recipient' property:

You can only send plain text messages. To send advanced SMS messages (like: flash, multi-part messages, data, ringtones, unicode, etc.) try the SmsProtocolGsm or SmsProtocolSmpp object.

There are two types of SMSC dial-in providers:

The SmsProtocolDialup object supports them both. Our list of supported SMSC providers shows the type of provider (TAP/XIO or UCP) for each provider. You must tell the SmsProtocolDialup object what type of provider you are going to dial:

Send an SMS message through an SMSC dial-up provider

The following sample shows how to send an SMS message through an SMSC provider. A standard 19200 modem is used to connect to the remote SMSC dial-in provider:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage instance
Set objConstants         = CreateObject("ActiveXperts.SmsConstants")       ' Create SmsConstants instance

objDialupProtocol.Device = "Standard 19200 bps Modem"

objDialupProtocol.ProviderType = objConstants.asPROVIDERTYPE_UCP      
objDialupProtocol.ProviderDialString = "+31653141414"                      ' Provider dial-in number

objSmsMessage.Recipient = "+4412345678"
objSmsMessage.Data = "Hello world!"

objDialupProtocol.Send ( objSmsMessage )     
WScript.Echo "Send, result: " & objDialupProtocol.LastError              
End If 

10.2. SmsProtocolDialup Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Version String Out n/a Product version number
Build String Out n/a Product build number
ExpirationDate String Out n/a Product expiration date
Device String In/Out M Name of the device you want to use for sending the SMS messages
DeviceSettings String In/Out O Identifier string indicating databits, parity and stopbits
DeviceSpeed Number In/Out O The baudrate of the communication session
DeviceFlowControl Number In/Out O Hardware flow control
DeviceInitString String In/Out O Initialization string for the device
DialMode Number In/Out O Tone or Pulse. Default: Tone
ProviderDialString String In/Out M Dial-string to dial-up to the provider
ProviderPassword String In/Out O Optional password to log on to the provider (UCP only)
ProviderType Number In/Out M Type of provider; can be UCP or TAP
LastError Number Out n/a Result of the last called function
ProviderResponse String Out n/a Last response from provider
LogFile String In/Out O All commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
GetDeviceCount Return the number of Windows telephony devices installed on the local computer
GetDevice Retrieve a Windows telephony device name
Send Deliver the message to the SMSC provider. The SMSC provider will send the SMS message to the recipient
GetErrorDescription Lookup error description of the given error code
ProviderLoadConfig Load SMSC specific parameters from a configuration file
ProviderSaveConfig Save SMSC specific parameters to a configuration file

10.3. SmsProtocolDialup Object - Properties

SmsProtocolDialup.Version property

Type:

String

Description:

Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objDialupProtocol = CreateObject( "ActiveXperts.SmsProtocolDialup" )
WScript.Echo "Version: " & objDialupProtocol.Version

SmsProtocolDialup.Build property

Type:

String

Description:

Build information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objDialupProtocol = CreateObject( "ActiveXperts.SmsProtocolDialup" )
WScript.Echo "Build: " & objDialupProtocol.Build

SmsProtocolDialup.ExpirationDate property

Type:

String

Description:

Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Once you have registered the product, the property holds the empty string value.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
WScript.Echo "ExpirationDate: " & objDialupProtocol.ExpirationDate
	

SmsProtocolDialup.Device property

Type:

String

Description:

The preferred device for sending SMS messages.
You can either use a Windows telephony device (recommended) or a physical COM port (directly).

Assign one of the following strings to the 'Device' property:

Windows telephony devices are highly recommended.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Device = "Standard 19200 bps Modem"                      ' Use a Windows telephony device (recommended)

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Device = "COM2"                                          ' Use a COM port directly

SmsProtocolDialup.DeviceSettings property

Type:

Number

Description:

By default, the databits/parity/stopbits settings are inherited from the Windows telephony device, or (in case a direct COM port is used) the default COM settings are used (8 databits, no parity, 1 stopbit).
This default is indicated by the asDEVICESETTINGS_DEFAULT value.

To overwrite the default value, assign one of the following values to the 'DeviceSettings' property:

The DeviceSettings propery is an important property of the SmsProtocolDialup object. Settings may vary among different providers; therefore it is important to specify the right settings. most dial-in providers require specific settings; see also the online list of SMSC dial-up providers around the world. NOTE: When assigning 'DeviceSettings' to a Windows telephony device, the settings are overwritten.

Example:

Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )      ' Create SmsMessage instance
Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance

objDialupProtocol.Device = "COM3"
objDialupProtocol.DeviceSettings = asDEVICESETTINGS_7E1                    ' This provider requires 7,e,1
objDialupProtocol.DeviceSpeed = 4800                                       ' This provider requires 4800 bps
objDialupProtocol.ProviderDialString = "11223344"
objDialupProtocol.ProviderType = asPROVIDERTYPE_UCP                        ' This provider supports: UCP

objSmsMessage.Recipient  = "0624896641"
objSmsMessage.Data       = "Hello world!"

objDialupProtocol.Send( objSmsMessage )

Example:

Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )      ' Create SmsMessage instance
Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance

objDialupProtocol.Device = "COM3"
objDialupProtocol.DeviceSettings = asDEVICESETTINGS_8N1                    ' This provider requires 8,n,1
objDialupProtocol.DeviceSpeed = 4800                                       ' This provider requires 4800 bps
objDialupProtocol.ProviderDialString = "22334455"
objDialupProtocol.ProviderType = asPROVIDERTYPE_TAP                        ' This provider supports: TAP

objSmsMessage.Recipient  = "0624896641"
objSmsMessage.Data       = "Hello world!"

objDialupProtocol.Send( objSmsMessage )

SmsProtocolDialup.DeviceSpeed property

Type:

String

Description:

By default, the speed settings are inherited from the Windows telephony device, or (in case a direct COM port is used) the default COM settings are used.
The default speed will usually suffice. Use 0 to use the default baudrate, or any valid baudrate value like: 1200, 2400, 4800, 9600, 14400, 19200, 38400, 56000, 57600, 115200, etc.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Device = "Standard 19200 bps Mode"
objDialupProtocol.DeviceSpeed = 4800                     ' This will overwrite the Windows telephony device speed
	

SmsProtocolDialup.DeviceFlowControl property

Type:

Number

Description:

Hardware flow control regulates communication between computer and device (usually a modem). There are two signals on the port for hardware flow control: DTR (Data Terminal Ready) and RTS (Request To Send). If you enable hardware flow control, computer and device will use both physical signals for flow control. It's very uncommon to change these values for modem communications. The 'DeviceFlowControl' will be ignored if the Device is a Windows telephony device, because flow control is already defined in the Windows telephony device properties (in the Windows Control Panel).
If a Windows telephony device is used (for instance: "Standard 19200 bps modem"), the 'DeviceFlowControl' property will be ignored because it is configured through the Control Panel.
For a list of flowcontrol values, click here.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")   ' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
objDialupProtocol.Device = "COM2"
objDialupProtocol.DeviceFlowControl = objSmsConstants.asFLOWCONTROL_DISABLE ' Disable hardware flow control

SmsProtocolDialup.DeviceInitString property

Type:

String

Description:

Initialization string for the modem. Following string is used to initialize a modem:

As said, the 'DeviceInitString' property is ignored if a Windows telephony device is used.
If you are using a direct port device, and you assign a string to the 'DeviceInitString' property, the string will be used to initialize the modem.

Important: commands can be separated by the ';' character, and will issued separately. So, if 'DeviceInitString' property holds the "ATZ" string, the toolkit first issues ATZ, waits for the OK response, then issues the AT&C1&K0 command and again waits for the OK response.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Device = "COM1"
objDialupProtocol.DeviceInitString = "AT&F;AT&C1&K0"                       ' Use a custom initialisation string

SmsProtocolDialup.DialMode property

Type:

Boolean

Description:

Set the 'DialMode' property to specify 'Tone' or 'Pulse' dialing:

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
objDialupProtocol.DialMode = objSmsConstants.asDIALMODE_PULSE              ' Use pulse instead of tone

SmsProtocolDialup.ProviderDialString property

Type:

String

Description:

Dial string to dial-up to the provider.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject ( "ActiveXperts.SmsConstants" )
Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )

objDialupProtocol.Device = "Standard 9600 bps Modem"

objDialupProtocol.ProviderDialString = "+31653141414"            ' Provider's full number, incl. prefix, dialing codes etc.
objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP  ' UCP or TAP

objSmsMessage.Sender     = "00000000000"                         ' UCP only; Use your mobile number; only digits allowed
objSmsMessage.Recipient  = "0624896641"                          ' Recipient's mobile number. Format depends on providers. 
                                                                 ' Common formats: 004412345678, 4412345678, 12345678
objSmsMessage.Data       = "Hello world!"

objDialupProtocol.Send( objSmsMessage ) 
WScript.Echo "Send, result: " & objDialupProtocol.Send

SmsProtocolDialup.ProviderPassword property

Type:

String

Description:

Password used to logon to the provider. The majority of the TAP/UCP providers do not require a password; however, if a password is required, you can set it here.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject ( "ActiveXperts.SmsConstants" )
Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )

objDialupProtocol.Device = "Standard 9600 bps Modem"

objDialupProtocol.ProviderDialString = "+4412345678"             ' Provider's full number, incl. prefix, dialing codes etc.
objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP ' UCP or TAP
objDialupProtocol.ProviderPassword = "topsecret"                 ' Password required

objSmsMessage.Sender     = "00000000000"                         ' UCP only; Use your mobile number; only digits allowed
objSmsMessage.Recipient  = "0624896641"                          ' Recipient's mobile number. Format depends on providers. 
                                                                 ' Common formats: 004412345678, 4412345678, 12345678
objSmsMessage.Data       = "Hello world!"

objDialupProtocol.Send( objSmsMessage ) 
WScript.Echo "Send, result: " & objDialupProtocol.Send

SmsProtocolDialup.ProviderType property

Type:

Number

Description:

Type of provider; click here for a list of values.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsConstants      = CreateObject ( "ActiveXperts.SmsConstants" )
Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )

objDialupProtocol.Device = "Standard 9600 bps Modem"

objDialupProtocol.ProviderDialString = "+31653141414"            ' Provider's full number, incl. prefix, dialing codes etc.
objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP ' UCP or TAP

objSmsMessage.Sender     = "00000000000"                                   
objSmsMessage.Recipient  = "0624896641"                                    
                                                                           
objSmsMessage.Data       = "Hello world!"
objDialupProtocol.Send( objSmsMessage ) 
WScript.Echo "Send, result: " & objDialupProtocol.Send

SmsProtocolDialup.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
...
objDialupProtocol.Send( .. )
WScript.Echo "LastError: " & objDialupProtocol.LastError

SmsProtocolDialup.ProviderResponse property

Type:

String

Description:

ProviderResponse holds the last response from the Dial-Up provider. Use it for troubleshooting.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
...
objDialupProtocol.Send( objSmsMessage ) 
WScript.Echo "Send, result: " & objDialupProtocol.LastError
WScript.Echo "Last Response: " & objDialupProtocol.ProviderResponse

SmsProtocolDialup.LogFile property

Type:

String

Description:

By default, LogFile holds the empty string so nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output data is written at the end of the file, the file is not cleared.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.LogFile = "c:\temp\mylogfile.log"
objDialupProtocol.Send( .. )

10.4. SmsProtocolDialup Object - Functions

SmsProtocolDialup.Activate function

Description:

This function activates the SMS and MMS Toolkit product. A valid registration code should be passed as parameter.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Activate "xxxxx-xxxxx-xxxxx", True ' Use a valid registration code
                                                     ' Pass True to make the activation persistent, so you need to call
                                                     ' Activate only once. If you pass False, you need to call Activate 
                                                     ' each time the product is started.

SmsProtocolDialup.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Send( .. )
objDialupProtocol.Clear()
objDialupProtocol.Send( .. )
objDialupProtocol.Clear()

SmsProtocolDialup.GetDeviceCount function

Description:

Returns the number of installed Windows telephony devices on the local computer.

Parameters:

Return value:

The number of installed Windows telephony devices. Check the LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol = CreateObject( "ActiveXperts.SmsProtocolDialup" )
WScript.Echo "Number of installed Windows telephony devices: " & objDialupProtocol.GetDeviceCount()

SmsProtocolDialup.GetDevice function

Description:

Returns the n-th Windows telephony device of the system. The number n can be between 0 and GetDeviceCount()-1.

Parameters:

Return value:

The name of the device. Call the LastError function to see if the function was completed successfully.
The name of the device can be assigned to the Device property to open a Windows telephony device.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
n = objDialupProtocol.GetDeviceCount()
For i = 0 to n-1
   WScript.Echo "Device " & i & ": " & objDialupProtocol.GetDevice( i )
Next

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
n = objDialupProtocol.GetDeviceCount()
For i = 0 to n-1
   WScript.Echo "Device " & i & ": " & objDialupProtocol.GetDevice( i )
Next

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
If( objDialupProtocol.GetDeviceCount() > 0 )
   objDialupProtocol.Device = objDialupProtocol.GetDevice( 0 )             ' Use the first Windows telephony device
   objDialupProtocol.Send( .. )
End If

SmsProtocolDialup.Send function

Description:

Deliver the SMS message to the SMSC provider. The provider will send the actual SMS to the recipient

Parameters:

Return value:

Always 0. Check the LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")         ' Create SmsMessage instance
Set objConstants         = CreateObject("ActiveXperts.SmsConstants")       ' Create SmsConstants instance

objDialupProtocol.Device = "Standard 2400 bps Modem"

objDialupProtocol.ProviderType = objConstants.asPROVIDERTYPE_UCP      
objDialupProtocol.ProviderDialString = "+31653141414"                      ' Provider dial-in number

objSmsMessage.Recipient = "+4412345678"
objSmsMessage.Data = "Hello world!"

objDialupProtocol.Send ( objSmsMessage )     
WScript.Echo "Send, result: " & objDialupProtocol.LastError

SmsProtocolDialup.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.Send( .. )
If objDialupProtocol.LastError <> 0 Then
   WScript.Echo "Error description: " & objDialupProtocol.GetErrorDescription( objDialupProtocol.LastError )
End If

SmsProtocolDialup.ProviderLoadConfig function

Description:

Load provider specific information from an dial-up configuration file.

ActiveXperts SMS and MMS Toolkit ships with various configuration files for different providers. Each configuration file contains TAP/UCP provider specific information. The 'ProviderLoadConfig' function loads the following properties:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
objDialupProtocol.ProviderLoadConfig ( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Dialup\Australia\Link.dial" )
...

SmsProtocolDialup.ProviderSaveConfig function

Description:

Save provider specific information to a SmsProtocolDialup configuration file.

You can save the following properties into a SmsProtocolDialup file:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objDialupProtocol    = CreateObject("ActiveXperts.SmsProtocolDialup")  ' Create SmsProtocolDialup instance
...
objDialupProtocol.ProviderDialString = "+31653141414"
objDialupProtocol.ProviderType = objSmsConstants.asPROVIDERTYPE_UCP      
...
objDialupProtocol.ProviderSaveConfig( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Sms\Dialup\MyProvider.dial" )

11. SmsData objects (WAP, vCards, MMS notifications)

11.1. Introduction

WAP Push and WAP Bookmark messages

WAP Push messages are specially formatted SMS messages that display an alert message to the user, and give the user the option of connecting directly to a particular URL via the mobile phone�s WAP browser.

The WAP specifications define a format for applications to create XML-based "PAP" (Push Access Protocol) documents that can be posted to an operator�s "PPG" (Push Proxy Gateway), in order to deliver a WAP Push message to a mobile device. The complexity of the WAP format has made it difficult for developers to deploy WAP Push in their applications in the past.

The SMS and MMS Toolkit makes it easy to generate and deliver WAP Push messages. You can send WAP Push messages using a GSM modem (or GSM phone), or using an SMPP provider. Use the SmsDataWapPush object to format the message of the SMS, and use the regular SmsProtocolGsm or SmsProtocolSmpp functions to send the Wap Push formatted message.

Sending Wap Bookmarks is just like sending Wap Push messages: use the SmsDataWapBookmark object to encode the Wap Bookmark message, and send out this message using SmsProtocolGsm or SmsProtocolSmpp.

The following sample shows how to send a WAP Push message using a GSM modem:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )      
Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )

objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "WAP Push"
objWapPush.SignalAction  =  objSmsConstants.asWAPPUSHSIGNAL_MEDIUM
objWapPush.Encode                                                          ' Encode Wap Message
WScript.Echo "Encoding WAP Push, result:" & objWapPush.LastError
If( objWapPush.LastError <> 0 ) Then
   WScript.Quit
End If

objGsmProtocol.Device     = "COM1"

objSmsMessage.Recipient   = "+31625044454"                                 ' Mobile number
objSmsMessage.Format      = objSmsConstants.asMESSAGEFORMAT_DATA_UDH       ' Data + UDH messagetype
objSmsMessage.Data        = objWapPush.EncodedMessage                      ' Assign encoded data to the message

objGsmProtocol.Send( objSmsMessage )

WScript.Echo "Sending message, result: " & objGsmProtocol.LastError

NOTE: You can also use SMPP instead of GSM to send out the WAP Push message.

WAP Bookmarks are like WAP Push messages: they are special "WAP" formatted messages. You can use the SmsDataWapBookmark object to format the message as a Wap Bookmark, use the regular SmsProtocolGsm or SmsProtocolSmpp functions to send the Wap Push formatted message.

The following sample shows how to send a WAP Bookmark message:

Set objGsmProtocol       = CreateObject("ActiveXperts.SmsProtocolGsm")
Set objSmsMessage        = CreateObject("ActiveXperts.SmsMessage")      
Set objWapBookmark       = CreateObject("ActiveXperts.SmsDataWapBookmark") ' Create SmsDataWapBookmark instance
Set objSmsConstants      = CreateObject("ActiveXperts.SmsConstants")

objWapBookmark.URL         = "http://www.activexperts.com"
objWapBookmark.Description = "ActiveXperts"

objWapBookmark.Encode                                                      ' Encode Wap Message
WScript.Echo "Encoding WAP Push, result:" & objWapBookmark.LastError
If( objWapBookmark.LastError <> 0 ) Then
   WScript.Quit
End If

objGsmProtocol.Device     = "COM1"

objSmsMessage.Recipient   = "+31625044454"                                 ' Mobile number
objSmsMessage.Format      = objSmsConstants.asMESSAGEFORMAT_DATA_UDH       ' Data + UDH messagetype
objSmsMessage.Data        = objWapBookmark.EncodedMessage                  ' Assign encoded data to the message

objGsmProtocol.Send ( objSmsMessage )   
WScript.Echo "Send, result: " & objGsmProtocol.LastError

NOTE: You can also use SMPP instead of GSM to send out the WAP Bookmark message.

MMS Notification Messages

An MMS notification is an indication on your mobile phone that tells you that a new MMS message has been received on the MMSC. Depending on your phone's settings, it will automatically download the MMS message from the MMSC if there is a GPRS or UMTS connection available.

The SMS and MMS Toolkit makes it easy to generate and deliver MMS notification messages. You can send Ringtone messages using a GSM modem (or GSM phone), or using an SMPP messages.

The following sample shows how to send a MMS notification message:

Set objGsmProtocol       = CreateObject ( "ActiveXperts.SmsProtocolGsm" )
Set objSmsMessage        = CreateObject ( "ActiveXperts.SmsMessage" )      
Set objNotification      = CreateObject ( "ActiveXperts.SmsDataMmsNotification" ) ' Create SmsDataMmsNotification instance
Set objSmsConstants      = CreateObject ( "ActiveXperts.SmsConstants" )

objNotification.Expiration      = 24                                              ' Message expires after 1 day
objNotification.Subject         = "MMS Notification Demo"
objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b"
objNotification.From            = "+31638740161"
objNotification.Class           = objSmsConstants.asMMS_MESSAGECLASS_PERSONAL
objNotification.MessageSize     = 7891    

objNotification.Encode
If( objNotification.LastError <> 0 ) Then
   WScript.Echo "Error encoding notification: " & objNotification.LastError
   WScript.Quit
End If

objSmsMessage.Recipient  = "+31612345678"
objSmsMessage.Format     = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
objSmsMessage.Data       = objNotification.EncodedMessage                         ' Assign encoded data to the message

objGsmProtocol.Device    = "COM1"
objGsmProtocol.Send( objSmsMessage )
WScript.Echo "Send, result: " & objGsmProtocol.LastError

vCard Messages

vCard messages are specially formatted SMS messages to send contact information to a mobile phone. A vCard is the electronic equivalent of a paper bussiness card.

vCards can also be send using MMS by attaching a .vcf or .vcard file to a slide. The vCard standard is specified in RFC documents RFC2425 an RFC2426.

The SMS and MMS Toolkit makes it easy to generate and deliver vCard's. You can send vCard messages using a GSM modem (or GSM phone), or using an SMPP provider. Use the SmsDatavCard object to format the message of the SMS, and use the regular SmsProtocolGsm or SmsProtocolSmpp functions to send the vCard formatted message.

The following sample shows how to send a vCard message using a GSM modem:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )      
Set objCard              = CreateObject( "ActiveXperts.SmsDatavCard" )     ' Create SmsDatavCard instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )

objCard.Name             = "John Doe"
objCard.Phone            = "555-1234"
objCard.Mobile           = "555-2222"

objCard.Encode                                                             ' Encode vCard Message

WScript.Echo "Encoding vCard, result:" & objCard.LastError
If( objCard.LastError <> 0 ) Then
   WScript.Quit
End If

objGsmProtocol.Device     = "COM1"

objSmsMessage.Recipient   = "+31625044454"                                 ' Mobile number
objSmsMessage.Format      = objSmsConstants.asMESSAGEFORMAT_DATA_UDH       ' Data + UDH messagetype
objSmsMessage.Data        = objCard.EncodedMessage                         ' Assign encoded data to the message

objGsmProtocol.Send( objSmsMessage )

WScript.Echo "Sending message, result: " & objGsmProtocol.LastError

NOTE: You can also use SMPP instead of GSM to send out the vCard message.

11.2. SmsDataWapPush Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
URL String In/Out M The URL to push
Description String In/Out O Description text, as it will appear on the recipient's mobile phone
SignalReference String In/Out O Reference that can be used to delete the message at a later stage
SignalAction Number In/Out O Priority of the WAP Push message
ExecuteAction Number In/Out O Action performed upon receiving of the WAP Push message
ConnectionType Number In/Out O Connection type used to execute the WAP Push message
EncodedMessage String Out M The encoded WAP Push message
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode the WAP Push message
GetErrorDescription Lookup error description of the given error code

11.2.1. SmsDataWapPush properties

SmsDataWapPush.URL property

Type:

String

Description:

The URL that you want to push to the recipient's mobile phone

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "..."
...

SmsDataWapPush.Description property

Type:

String

Description:

The Description text, as it will appear on the recipient's mobile phone.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "This is a WAP Push message"

SmsDataWapPush.SignalReference property

Type:

String

Description:

Reference that can be used to delete the message at a later stage.
You can assign any alpha-numeric string to it.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "This is a WAP Push message"
objWapPush.SignalReference = "0000A0"
...
objWapPush.Encode
...

SmsDataWapPush.SignalAction property

Type:

Number

Description:

The type of WAP Push action. Either defines a message priority, or a delete action.
Click here for a list of valid signal actions.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "This is a WAP Push message"
objWapPush.SignalAction  = objSmsConstants.asWAPPUSHSIGNAL_HIGH
...
objWapPush.Encode

SmsDataWapPush.ConnectionType property

Type:

Number

Description:

The type of WAP Push message. This could be either a service-indication or service-load push message.
Service Indication messages are used to notify the user that new WAP content is available, Service Load messages forces the phone to go directly to the content without user intervention (depending on the security level of your mobile phone).
Click here for a list of valid connection types.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objWapPush.URL             = "http://wap.yahoo.com"
objWapPush.Description     = "This is a WAP Push message"
objWapPush.ConnectionType  = objSmsConstants.asWAPPUSH_SERVICE_INDICATION
objWapPush.SignalAction    = objSmsConstants.asWAPPUSHSIGNAL_HIGH
...
objWapPush.Encode
...

SmsDataWapPush.ExecuteAction property

Type:

Number

Description:

The type of WAP Push execute action. This parameter is only used when creatin a service-load wap push message.
Click here for a list of valid execute actions.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )
...
objWapPush.URL             = "http://wap.yahoo.com"
objWapPush.ExecuteAction   = objSmsConstants.asWAPPUSH_ACTION_EXECUTE_HIGH
objWapPush.ConnectionType  = objSmsConstants.asWAPPUSH_SERVICE_LOAD
...
objWapPush.Encode
...

SmsDataWapPush.EncodedMessage property

Type:

String

Description:

This property holds the encoded message as it was encoded by the Encode function. Assign the 'EncodedMessage' string to the SmsMessage.Data property to send an SMS WAP Push message via either Gsm or Smpp.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )      
Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )

objWapPush.URL           = "http://wap.yahoo.com"
objWapPush.Description   = "WAP Push"
objWapPush.SignalAction  =  objSmsConstants.asWAPPUSHSIGNAL_MEDIUM
objWapPush.Encode                                                          ' Encode Wap Message
If ( objWapPush.LastError = 0 ) Then
    objSmsMessage.Data      = objWapPush.EncodedMessage
    objSmsMessage.Format    = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
    objSmsMessage.Recipient = " ... "
    ...
    objGsmProtocol.Send( objSmsMessage )
End If

SmsDataWapPush.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objWapPush           = CreateObject( "ActiveXperts.SmsDataWapPush" )   ' Create SmsDataWapPush instance
...
objWapPush.Encode()
WScript.Echo "LastError: " & objWapPush.LastError

11.2.2. SmsDataWapPush - Functions

SmsDataWapPush.Encode function

Description:

Encode a WAP Push message. After the function has completed successfully, the EncodedMessage property holds the encoded data so that it can be assigned to the SmsMessage::Data property.

Parameters:

Return value:

Always 0. Check the 'LastError' property to see if the function was completed successfully

Example:

Set objWapPush = CreateObject( "ActiveXperts.SmsDataWapPush" )
...
objWapPush.Encode()
If( objWapPush.LastError = 0 ) Then
   WScript.Echo "Message successfully encoded"
End If

SmsDataWapPush.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objWapPush = CreateObject( "ActiveXperts.SmsDataWapPush" )
...
objWapPush.Encode()
WScript.Echo "Result: " & objWapPush.GetErrorDescription( objWapPush.LastError )

11.3. SmsDataWapBookmark Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
URL String In/Out M The URL to set as bookmark
Description String In/Out O Description text, as it will appear on the recipient's mobile phone
EncodedMessage String Out M The encoded WAP bookmark message
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode the WAP Bookmark message
GetErrorDescription Lookup error description of the given error code

11.3.1. SmsDataWapBookmark properties

SmsDataWapBookmark.URL property

Type:

String

Description:

The URL that you want to set as bookmark on the recipient's mobile phone.

Example:

Set objWapBookmark         = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
objWapBookmark.URL         = "http://www.activexperts.com"
objWapBookmark.Description = "..."
...

SmsDataWapBookmark.Description property

Type:

String

Description:

The Description text, as it will appear on the recipient's mobile phone.

Example:

Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
objWapBookmark.URL          = "http://www.activexperts.com"
objWapBookmark.Description  = "ActiveXperts Software - Home Page"
...

SmsDataWapBookmark.EncodedMessage property

Type:

String

Description:

This property holds the enocded message as it was encoded by the Encode function. Assign the 'EncodedMessage' string to the SmsMessage.Data property to send an SMS WAP Bookmark message via either Gsm or Smpp.

Example:

Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )
Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )      
Set objWapBookmark       = CreateObject( "ActiveXperts.SmsDataWapBookmark" )   ' Create SmsDataWapBookmark instance
Set objSmsConstants      = CreateObject( "ActiveXperts.SmsConstants" )

objWapBookmark.URL        = "http://www.activexperts.com"
objWapBookmark.Description = "ActiveXperts"

objWapBookmark.Encode                                                          ' Encode Wap Message
If ( objPicture.LastError = 0 ) Then
   objSmsMessage.Data      = objWapBookmark.EncodedMessage
   objSmsMessage.Format    = objSmsConstants.asMESSAGEFORMAT_DATA_UDH
   objSmsMessage.Recipient = " ... "
   ...
   objGsmProtocol.Send( objSmsMessage )
End If

SmsDataWapBookmark.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
...
objWapBookmark.Encode()
WScript.Echo "LastError: " & objWapBookmark.LastError

11.3.2. SmsDataWapBookmark functions

SmsDataWapBookmark.Encode function

Description:

Encode a WAP Push message. After the function has completed successfully, the EncodedMessage property holds the encoded data so that it can be assigned to the SmsMessage.Data property.

Parameters:

Return value:

Always 0. Check the 'LastError' property to see if the function was completed successfully.

Example:

Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
...
objWapBookmark.Encode()
If( objWapBookmark.LastError = 0 ) Then
   WScript.Echo "WAP bookmark message successfully encoded"
End If

SmsDataWapBookmark.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

he error string.

Example:

Set objWapBookmark = CreateObject( "ActiveXperts.SmsDataWapBookmark" )
...
objWapBookmark.Encode()
WScript.Echo "Result: " & objWapBookmark.GetErrorDescription( objWapBookmark.LastError )

11.4. SmsDataMmsNotification Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
ContentLocation String In/Out M Location (URL) of the MMS message
Expiration Number In/Out O Message expiration
Subject String In/Out O Subject of the message
Class Number In/Out O Class of the message
From String In/Out O Sender of the message
MessageSize Number In/Out O The size of the message
EncodedMessage String Out M The encoded notification message
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode mms notification data
GetErrorDescription Lookup error description of the given error code

11.4.1. SmsDataMmsNotification Object - Properties

SmsDataMmsNotification.ContentLocation property

Type:

String

Description:

Location of the MMS message. This should be a valid URL pointing to the MMSC server. For instance: http://mmsc.activexperts.com/2006001/a6789a.mms.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b"
...  
objNotification.Encode()
WScript.Echo "LastError: " & objNotification.LastError

SmsDataMmsNotification.Expiration property

Type:

Number

Description:

After this time the message expires and will be deleted from the MMSC. This value has to be specified in hours. When the expiration time is 4 days, specify '96'.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.Expiration = 24                                            ' Message expires after 1 day 
...  
objNotification.Encode()
WScript.Echo "LastError: " & objNotification.LastError

SmsDataMmsNotification.Subject property

Type:

String

Description:

The subject of the message on the MMSC. This value is optional.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.Subject = "MMS Notification Demo"
...  
objNotification.Encode()
...
WScript.Echo "LastError: " & objNotification.LastError

SmsDataMmsNotification.Class property

Type:

Number

Description:

Indicates the message class of the MMS message. When no class is specified the 'Personal' message class is used. For a list of possible values, click here.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.Class = objSmsConstants.asMMS_NOTIFICATION_PERSONAL
...  
objNotification.Encode()
...
WScript.Echo "LastError: " & objNotification.LastError

SmsDataMmsNotification.From property

Type:

String

Description:

The sender of the MMS message. This value can be either a phone number or e-mail address.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.From = "+31612345678"
...  
objNotification.Encode()
...

SmsDataMmsNotification.MessageSize property

Type:

Number

Description:

This field indicates the message size of the message on the MMSC. This field has nothing to do with the size of the notification message itself.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.MessageSize = 6385
...  
objNotification.Encode()
...

SmsDataMmsNotification.EncodedMessage property

Type:

String

Description:

The encoded notification message data. Pass this data to either the SMPP or GSM objects to send the message.

Example:

Set objGsmProtocol  = CreateObject("ActiveXperts.SmsProtocolGsm" )         ' Create SmsProtocolGsm instance
Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
Set objSmsMessage   = CreateObject("ActiveXperts.SmsMessage")              ' Create SmsMessage instance
...
objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b"
...
objNotification.Encode
...
objSmsMessage.Data   = objNotification.EncodedMessage
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

objGsmProtocol.Send( objSmsMessage )
...

SmsDataMmsNotification.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.Encode()
WScript.Echo "LastError: " & objNotification.LastError

11.4.2. SmsDataMmsNotification - Functions

SmsDataMmsNotification.Encode function

Description:

Encode an MMS notification message. After the function has completed successfully, the EncodedMessage property holds the encoded data so that it can be assigned to the SmsMessage::Data property.

Parameters:

Return value:

Always 0. Check the LastError property to see if the function was completed successfully

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
Set objSmsMessage   = CreateObject("ActiveXperts.SmsMessage")              ' Create SmsMessage instance
...
objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b"
...
objNotification.Encode
...
objSmsMessage.Data   = objNotification.EncodedMessage
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

objGsmProtocol.Send( objSmsMessage )
...

SmsDataMmsNotification.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objNotification = CreateObject("ActiveXperts.SmsDataMmsNotification")  ' Create SmsDataMmsNotification instance
...
objNotification.ContentLocation = "http://mmsc.activexperts-labs.com/mmsc/b12237b"
...
objNotification.Encode
...
WScript.Echo "Result: " & objNotification.GetErrorDescription ( objNotification.LastError )

11.5. SmsDatavCard Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Name String In/Out M Name of the person
Phone String In/Out O Main phone number
PhoneWork String In/Out O Work phone number
PhoneHome String In/Out O Home phone number
Mobile String In/Out O Mobile (cell)phone number
Pager String In/Out O Pager phone number
Fax String In/Out O Fax number
Email String In/Out O Email address
Title String In/Out O Person's title
Url String In/Out O Company or personal URL
EncodedMessage String Out M The encoded vCard message
LastError Number Out n/a Result of the last called function

Function Description
Encode Encode vCard data
GetErrorDescription Lookup error description of the given error code

11.5.1. SmsDatavCard Object - Properties

SmsDatavCard.Name property

Type:

String

Description:

Name of the person.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name = "John Doe"
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Phone property

Type:

String

Description:

Phone number.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name  = "John Doe"                               ' Name 
objCard.Phone = "5551234"                                ' Phonenumber
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastErro

SmsDatavCard.PhoneWork property

Type:

String

Description:

Phone number at work.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.PhoneWork = "5551234"                            ' Phonenumber
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.PhoneHome property

Type:

String

Description:

The (private) home phonenumber

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.PhoneHome = "5551234"                            ' Phonenumber
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Mobile property

Type:

String

Description:

Mobile number.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Mobile    = "5551234"                            ' Cell Phone Number
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Pager property

Type:

String

Description:

Pager number

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Pager     = "5554321"                            ' Pager Number
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Fax property

Type:

String

Description:

Fax number

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Fax       = "55512345687"                        ' Fax Number
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Email property

Type:

String

Description:

E-mail address.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Email     = "john.doe@thecompany.com"            ' E-mail address
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Title property

Type:

String

Description:

Title associated with the name.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Title     = "Managing Director"                  ' Title
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.Url property

Type:

String

Description:

Person's or company's URL.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Name      = "John Doe"                           ' Name 
objCard.Url       = "www.thecompany.com"                 ' URL
...  
objCard.Encode()
WScript.Echo "LastError: " & objCard.LastError

SmsDatavCard.EncodedMessage property

Type:

String

Description:

The encoded vCard message data. Assign the 'EncodedMessage' string to the SmsMessage.Data property to send an vCard message via either Gsm or Smpp.

Example:

Set objGsmProtocol  = CreateObject("ActiveXperts.SmsProtocolGsm" )         ' Create SmsProtocolGsm instance
Set objCard         = CreateObject("ActiveXperts.SmsDatavCard")            ' Create SmsDatavCard instance
Set objSmsMessage   = CreateObject("ActiveXperts.SmsMessage")              ' Create SmsMessage instance
...
objCard.Name  = "John Doe"                                                 ' Name 
objCard.Phone = "5551234"                                                  ' Phonenumber
...
objCard.Encode
...
objSmsMessage.Data   = objCard.EncodedMessage
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

objGsmProtocol.Send( objSmsMessage )
...

SmsDatavCard.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property.
The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Encode()
...
WScript.Echo "LastError: " & objCard.LastError

11.5.2. SmsDatavCard - Functions

SmsDataWapBookmark.Encode function

Description:

Encode a vCard message. After the function has completed successfully, the EncodedMessage property holds the encoded data so that it can be assigned to the SmsMessage.Data property.

Parameters:

Return value:

Always 0. Check the LastError property to see if the function was completed successfully.

Example:

Set objCard         = CreateObject("ActiveXperts.SmsDatavCard")            ' Create SmsDatavCard instance
Set objSmsMessage   = CreateObject("ActiveXperts.SmsMessage")              ' Create SmsMessage instance
...
objCard.Name  = "John Doe"                                                 ' Name 
objCard.Phone = "5551234"                                                  ' Phonenumber
...
objCard.Encode
...
objSmsMessage.Data   = objCard.EncodedMessage
objSmsMessage.Format = objSmsConstants.asMESSAGEFORMAT_DATA_UDH

objGsmProtocol.Send( objSmsMessage )
...

SmsDataWapBookmark.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objCard = CreateObject("ActiveXperts.SmsDatavCard")  ' Create SmsDatavCard instance
...
objCard.Encode()
...
WScript.Echo "Result: " & objCard.GetErrorDescription ( objCard.LastError )

12. SmsDeliveryStatus Object

12.1. SmsDeliveryStatus Object - Introduction

The SMPP protocol and GSM protocol both support delivery status reports. A delivery status report holds the status of a message. It also has a flag that shows if the message is completed (i.e. successfully sent or failed) or not.

The use of a delivery status report is demonstrated by the following GSM sample:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+4412345678"                                   
objSmsMessage.Data       = "Hello, world!"                                 
objSmsMessage.RequestDeliveryStatus = True                       ' IMPORTANT: Use True in order to allow status reports

objGsmProtocol.Device    = "Nokia 6310i Modem"                   ' Use a Nokia Windows Telephony device 
strMessageRef = objGsmProtocol.Send( objSmsMessage )
If objGsmProtocol.LastError = 0 Then
   bContinueQueryStatus = True
   While( bContinueQueryStatus )
     WScript.Sleep 5000
     Set objDeliveryStatus = objGsmProtocol.QueryStatus( strMessageRef, True )
     If( objGsmProtocol.LastError = 0 ) Then
       WScript.Echo "Failed to query status, error: " & objGsmProtocol.LastError
       If( objDeliveryStatus.IsCompleted ) Then
         WScript.Echo "  Completed, StatusCode=" & objDeliveryStatus.StatusCode & _
                      "; StatusTime=" & objDeliveryStatus.StatusCompletedTime
         bContinueQueryStatus = False
       End If
     End If
   WEnd
End If

12.2. SmsDeliveryStatus Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Status Number Out n/a Status of the message
StatusDescription Number Out n/a Status description of the message
StatusCode Number Out n/a Operator dependent info about the status of the message
IsCompleted Boolean Out n/a Indicates if message is in its final state
StatusCompletedTimeSecs Number Out n/a Time in seconds after 1/1/1970 that message reached its final state
StatusCompletedTime Number Out n/a Time (formatted string) that message reached its final state
ProviderReference String String Out n/a Gets the message reference returned by the provider for a given internal message reference

12.2. SmsDeliveryStatus Object - Overview of Properties and Functions

12.3.1. SmsDeliveryStatus properties

SmsDeliveryStatus.Status
StatusDescription,StatusCode
IsCompleted
StatusCompletedTimeSecs
StatusCompletedTime
ProviderReference properties

Type:

String

Description:

The 'Status' property indicates the status of a message. For a list of possible values, click here.
The 'StatusDescription' property is a friendly string represnetation of the 'Status' property.
The 'StatusCode' property provides operator specific information about the status of a message.
The 'IsCompleted' property indicates if the message has reached it final state or not.
The 'StatusCompletedTimeSecs' specifies the time (in seconds after 1/1/1970) that the message was completed.
The 'StatusCompletedTime' specifies the time (as a formatted string) that the message was completed.
The 'ProviderReference' specified the message reference as returned by the provider instead of the internal message reference.

Example:

Set objSmsMessage        = CreateObject( "ActiveXperts.SmsMessage" )       ' Create SmsMessage instance
Set objGsmProtocol       = CreateObject( "ActiveXperts.SmsProtocolGsm" )   ' Create SmsProtocolGsm instance

objSmsMessage.Recipient  = "+4412345678"                                   
objSmsMessage.Data       = "Hello, world!"                                 
objSmsMessage.RequestDeliveryStatus = True                       ' IMPORTANT: Use True in order to allow status reports

objGsmProtocol.Device    = "Nokia 6310i Modem"                   ' Use a Nokia Windows Telephony device 
strMessageRef = objGsmProtocol.Send( objSmsMessage )
If objGsmProtocol.LastError = 0 Then
   bContinueQueryStatus = True
   While( bContinueQueryStatus )
     WScript.Sleep 5000
     Set objDeliveryStatus = objGsmProtocol.QueryStatus( strMessageRef )
     If( objGsmProtocol.LastError = 0 ) Then
       WScript.Echo "Failed to query status, error: " & objGsmProtocol.LastError
       If( objDeliveryStatus.IsCompleted ) Then
         WScript.Echo "  Completed, StatusCode=" & objDeliveryStatus.StatusCode & _
                      "; StatusTime=" & objDeliveryStatus.StatusCompletedTime
         bContinueQueryStatus = False
       End If
     End If
   WEnd
End If

13. Pager Messaging with SMS and MMS Toolkit

13.1. Introduction

With ActiveXperts SMS and MMS Toolkit, you can send Pager messages via SNPP. SNPP is an OSI Layer-7 IP protocol and stands for Simple Network Paging Protocol. It is a standard for sending wireless messages to paging devices. SNPP provides a simple way to make a link between the Internet and a SNPP compliant paging terminal.

The following code snippet (VBScript) illustrate how to use SMS and MMS Toolkit for sending pager messages.

Set objPagerProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )    ' Create PagerProtocolSnpp instance
Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Recipient = "5551234"                                      ' Set recipient number
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

objPagerProtocol.Server = "snpp.pageallcom.com"
objPagerProtocol.ServerPort = 444
objPagerProtocol.ServerTimeout =  2500                                     ' Set timeout to 2500 msecs

objPagerProtocol.Send( objPagerMessage )                                   ' Send the pager message

WScript.Echo "Send, result; " & objPagerProtocol.LastError
WScript.Echo "Last response from SNPP provider: " & objPagerProtocol.ProviderResponse

13.2. Visual Basic .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual Basic Solution Explorer:

You can create a new PagerMessage object in the following way:

Imports AXmsCtrl
...
Dim objPagerMessage As PagerMessage  = New PagerMessage() 

You can create a new PagerProtocolSnpp object in the following way:

Imports AXmsCtrl
...
Dim objSnppProtocol As PagerProtocolSnpp  = New PagerProtocolSnpp()

After these declarations and creation of the object(s), you can use the objects in your Visual Basic .NET projects.

13.3. Visual C# .NET

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual C# Solution Explorer:

You can create a new PagerMessage object in the following way:

using AXmsCtrl;
...
PagerMessage objPagerMessage = new PagerMessage();

You can create a new PagerProtocolSnpp object in the following way:

using AXmsCtrl;
...
PagerProtocolSnpp objPagerProtocolSnpp = new PagerProtocolSnpp();

After these declarations and creation of the object(s), you can use the objects inside your Visual C# .NET code.

13.4. Visual Basic

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual Basic 5.x or higher. In Visual Basic, go to the 'Project/References...' menu item and check the box next to 'ActiveXperts SMS and MMS Toolkit' Type Library. Now, you can declare and create Pager objects.

You can create a new PagerMessage object in the following way:

Dim objPagerMessage As AXmsCtrl.PagerMessage                            
Set objPagerMessage = CreateObject( "ActiveXperts.PagerMessage" ) 

You can create a new PagerProtocolSnpp object in the following way:

Dim objSnppProtocol As AXmsCtrl.PagerProtocolSnpp                            
Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )

After these declarations and creation of the object(s), you can use the objects in your Visual Basic projects.

13.5. Visual C++

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

SMS and MMS Toolkit can be used in Visual C++ projects. Include the *.h and *.c file provided by ActiveXperts to bind your code to the SMS component. These files are located in the Include directory of the Visual C++ samples directory. These are the files:

You can create a new PagerMessage object in the following way:

IPagerMessage              *pPagerMessage;                         
CoCreateInstance(CLSID_PagerMessage, NULL, CLSCTX_INPROC_SERVER, IID_IPagerMessage, (void**) &pPagerMessage);

You can create a new PagerProtocolSnpp object in the following way:

IPagerProtocolSnpp            *pSnppProtocol;                         
CoCreateInstance(CLSID_PagerProtocolSnpp, NULL, CLSCTX_INPROC_SERVER, IID_IPagerProtocolSnpp, (void**) &pSnppProtocol); 

13.6. Delphi 6.x or higher

Make sure the SMS and MMS Toolkit is installed on your system. For details about installation, click here.

First, add a reference to the SMS and MMS Toolkit objects:

You can create a new PagerMessage object in the following way:

PagerMessage      :  TPagerMessage;                                        ' Declaration of the wrapper class
objPagerMessage   :  IPagerMessage;                                        ' Declaration of the interface class
objPagerMessage   := PagerMessage.DefaultInterface;                        ' Creation new instance of the object

You can create a new PagerProtocolSnpp object in the following way:

PagerProtocolSnpp :  TPagerProtocolSnpp;                                   ' Declaration of the wrapper class
objSnppProtocol   :  IPagerProtocolSnpp;                                   ' Declaration of the interface class
objSnppProtocol   := PagerProtocolSnpp.DefaultInterface;                   ' Creation new instance of the object

After these declarations and creation of the object(s), you can use the objects in your Delphi projects.

13.7. ASP 2.x environment

Simply create the objects in the following way:

<html>
<body>
Version:
<script language=vbscript runat=server>
  Set objSnppProtocol    = CreateObject( "ActiveXperts.PagerProtocolSnpp" )
  Set objPagerMessage    = CreateObject( "ActiveXperts.PagerMessage" )
  ....
  Response.Write objSnppProtocol.Version
  ....
</script>
</body>
</html>

14. PagerMessage Object

14.1. PagerMessage Object - Introduction

The PagerMessage object hold all properties of a Pager message. It is used for outgoing pager messaging, and can be used as parameter in the PagerProtocolSnpp.Send function.

Create a new Pager message

The following sample shows how to create a new Pager message:

Set objPagerProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )    ' Create PagerProtocolSnpp instance
Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Clear()
objPagerMessage.Recipient = 5551234                                        ' Set recipient number
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

14.2. PagerMessage Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Recipient String In/Out M Recipient's pager ID
Data String In/Out O Pager message text
Function Description
Clear Clear all properties

14.3. PagerMessage Object - Properties

PagerMessage.Recipient property

Type:

String

Description:

The Recipient's Pager ID. If not assigned, the PagerProtocolSnpp.Send function will fail.

Example:

Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Clear()
objPagerMessage.Recipient = 5551234                                        ' Set recipient number

PagerMessage.Data property

Type:

String

Description:

The actual message data; only ASCII data is allowed (no binary data, no Unicode).

Example:

Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Clear()
objPagerMessage.Recipient = 5551234                                        
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

14.4. PagerMessage Object - Functions

PagerMessage.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Example:

Set objPagerMessage        = CreateObject( "ActiveXperts.PagerMessage" )       ' Create PagerMessage instance
...
objPagerMessage.Recipient  = "+4412345678"
objPagerMessage.Clear()
...

15. PagerProtocolSnpp Object

15.1. PagerProtocolSnpp Object - Introduction

Simple Network Paging Protocol (SNPP) is a standard for sending wireless messages to pagers. In its simplest form, SNPP provides a simple way to make a link between the Internet and a Telocator Alphanumeric input Protocol (TAP) paging terminal.

Send a Pager message using an SNPP service provider

The following sample shows how to send a Pager message using SNPP

Set objPagerProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )    ' Create PagerProtocolSnpp instance
Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Recipient = 5551234                                        ' Set recipient number
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

objPagerProtocol.Server = "snpp.pageallcom.com"
objPagerProtocol.ServerPort = 444
objPagerProtocol.ServerTimeout =  2500                                     ' Set timeout to 2500 msecs

objPagerProtocol.Send( objPagerMessage )                                   ' Send the pager message

WScript.Echo "Send, result; " & objPagerProtocol.LastError
WScript.Echo "Last response from SNPP provider: " & objPagerProtocol.ProviderResponse

15.2. PagerProtocolSnpp Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
Version String Out n/a Product version number
Build String Out n/a Product build number
ExpirationDate String Out n/a Product expiration date
Server String In/Out M SNPP server hostname or IP Address
ServerPort Number In/Out O SNPP server TCP port. Default: 444
ServerTimeout Number In/Out O SNPP server command timeout in milliseconds. Default: 2000 milliseconds
ProviderPassword String In/Out O Optional password used by SNPP provider
LastError Number Out n/a Result of the last called function
ProviderResponse String Out n/a Last response from provider
LogFile String In/Out O All commands and responses are logged to this file

Function Description
Activate Activate the product
Clear Clear all properties
Send Deliver the message to the SMSC provider. The SMSC provider will send the SMS message to the recipient
GetErrorDescription Lookup error description of the given error code

15.3. PagerProtocolSnpp Object - Properties

PagerProtocolSnpp.Version property

Type:

String

Description:

Version information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
WScript.Echo "Version: " & objSnppProtocol.Version

PagerProtocolSnpp.Build property

Type:

String

Description:

Build information of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
WScript.Echo "Build: " & objSnppProtocol.Build

PagerProtocolSnpp.ExpirationDate property

Type:

String

Description:

Expiration date of SMS and MMS Toolkit. This property is read-only; you cannot assign a value to it.
Once you have registered the product, the property holds the empty string value.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
WScript.Echo "ExpirationDate: " & objSnppProtocol.ExpirationDate

PagerProtocolSnpp.Server property

Type:

String

Description:

Sets the hostname or TCP/IP address of the SNPP server provider.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
objSnppProtocol.Server = "snpp.pageallcom.com"                             ' SNPP server hostname or IP Address
...
objSnppProtocol.Send( .. )                                                 ' Send pager message

PagerProtocolSnpp.ServerPort property

Type:

Number

Description:

Sets the TCP port for the SNPP connection. This property is optional, the default value is 444.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
objSnppProtocol.Server= "snpp.pageallcom.com"                              
objSnppProtocol.ServerPort = 4040                                          ' Use port 4040 instead of default port 444
...
objSnppProtocol.Send( .. )

PagerProtocolSnpp.ServerTimeOut property

Type:

Number

Description:

Maximum time (in milliseconds) before a Send operation will timeout. Default value: 2000 milliseconds.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" ) ' Create PagerProtocolSnpp instance
objSnppProtocol.Server= "snpp.pageallcom.com"                              
objSnppProtocol.ServerTimeout   = 4000                                 ' 4000 milliseconds before the Send call times out
...
objSnppProtocol.Send( .. )

PagerProtocolSnpp.ProviderPassword property

Type:

String

Description:

The password to be used with the provider.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
Set objPagerMessage = CreateObject( "ActiveXperts.PagerMessage" )          ' Create PagerMessage instance

objPagerMessage.Recipient = 5551234                                        ' Set recipient number
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

objSnppProtocol.Server = "snpp.pageallcom.com"
objSnppProtocol.ServerPort = 444
objSnppProtocol.ProviderPassword = "secret"                                ' Set password
objSnppProtocol.Send( objPagerMessage )                                    ' Send the pager message

WScript.Echo "Send, result; " & objSnppProtocol.LastError
WScript.Echo "Last response from SNPP provider: " & objSnppProtocol.ProviderResponse

PagerProtocolSnpp.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last Send function call. The property is read-only; you cannot assign a value to it.
For more information about error codes, click here.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
...
objSnppProtocol.Send( .. )
WScript.Echo "LastError: " & objSnppProtocol.LastError

PagerProtocolSnpp.ProviderResponse property

Type:

String

Description:

The last response from the provider. You can use this property for troubleshooting purposes. The property is read-only; you cannot assign a value to it.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
Set objPagerMessage = CreateObject( "ActiveXperts.PagerMessage" )          ' Create PagerMessage instance

objPagerMessage.Recipient = 5551234                                       
objPagerMessage.Data = "Hello World !!!"                                  

objSnppProtocol.Server = "snpp.pageallcom.com"
objSnppProtocol.ServerPort = 444
objSnppProtocol.Send( objPagerMessage )                                    ' Send the pager message

WScript.Echo "Send, result:  " & objSnppProtocol.LastError
WScript.Echo "Last response: " & objSnppProtocol.ProviderResponse          ' Display last reposnse of the provider

PagerProtocolSnpp.LogFile property

Type:

String

Description:

By default, 'LogFile' holds an empty string and - as a result - nothing is logged. If you assign a valid file name to it, all device commands and responses will be written to this log file.
Output data is written at the end of the file, the file is not cleared.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
objSnppProtocol.LogFile = "c:\temp\mylogfile.log"                          ' Set logfile
...
objSnpp.Send( .. )

15.4. PagerProtocolSnpp Object - Functions

PagerProtocolSnpp.Activate function

Description:

This function activates the SMS and MMS Toolkit product. A valid registration code should be passed as parameter.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
objSnppProtocol.Activate "xxxxx-xxxxx-xxxxx", True   ' Use a valid registration code
                                                     ' Pass True to make the activation persistent, so you need to call
                                                     ' Activate only once. If you pass False, you need to call Activate 
                                                     ' each time the product is started.

PagerProtocolSnpp.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )    ' Create PagerProtocolSnpp instance
...
objSnpp.Send( .. )
objSnpp.Clear()                                                           ' Reset all properties
...
objSnpp.Send( .. )
objSnpp.Clear()

PagerProtocolSnpp.Send function

Description:

Send a Pager message.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objSnppProtocol  = CreateObject( "ActiveXperts.PagerProtocolSnpp" )    ' Create PagerProtocolSnpp instance
Set objPagerMessage  = CreateObject( "ActiveXperts.PagerMessage" )         ' Create PagerMessage instance

objPagerMessage.Recipient = 5551234                                        ' Set recipient number
objPagerMessage.Data = "Hello World !!!"                                   ' Set pager message

objSnppProtocol.Server = "snpp.pageallcom.com"
objSnppProtocol.ServerPort = 444
objSnppProtocol.ServerTimeout =  2500                                      ' Set timeout to 2500 msecs

objSnppProtocol.Send( objPagerMessage )                                    ' Send the pager message

WScript.Echo "Send, result: " & objSnppProtocol.LastError
WScript.Echo "Last response from SNPP provider: " & objSnppProtocol.ProviderResponse

PagerProtocolSnpp.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objSnppProtocol = CreateObject( "ActiveXperts.PagerProtocolSnpp" )     ' Create PagerProtocolSnpp instance
Set objPagerMessage = CreateObject( "ActiveXperts.PagerMessage" )          ' Create PagerMessage instance
...
objSnppProtocol.Send( objPagerMessage )                                    ' Send the pager message

WScript.Echo "Send, result: " & objSnppProtocol.LastError & " - " & _
                                objSnppProtocol.GetErrorDescription( objSnppProtocol.LastError )

16. MMS messaging with SMS and MMS Toolkit

16.1. Introduction

There are three ways to send MMS messages using the SMS and MMS Toolkit:

The following code snippets (VBScript) illustrate how to send an MMS message using ActiveXperts SMS and MMS Toolkit.

MM1: Send an MMS message via a GPRS Modem
Set objMm1Protocol       = CreateObject ( "ActiveXperts.MmsProtocolMm1" )  ' Create a new instance of MmsProtocolMm1
Set objMmsMessage        = CreateObject ( "ActiveXperts.MmsMessage" )      ' Create a new instance of MmsMessage
Set objSlide             = CreateObject ( "ActiveXperts.MmsSlide" )        ' Create a new instance of MmsSlide
Set objConstants         = CreateObject ( "ActiveXperts.MmsConstants" )    ' Create a new instance of MmsConstants

' MmsSlide: Add duration, attachments(s) and text(s)
objSlide.Clear()
objSlide.Duration        = 10                                      ' Display this screen for 10 seconds
objSlide.AddAttachment( "logo.gif" )                               ' Add a multimedia attachment
objSlide.AddText( "The ActiveXperts logo" )                        ' Add a description

' MmsMessage: Set properties
objMmsMessage.Clear()                                              ' Clear the message object (good practise)
objMmsMessage.Subject    = "My Message"                            ' Subject of the message
objMmsMessage.AddRecipient ( "+4412345678" )                       ' MMS recipient;phonenumbers and e-mail addresses allowed

' MmsMessage: Add slide
objMmsMessage.AddSlide( objSlide )                                 ' Add slide to the message; you can add multiple slides

' MMS Connection: Set device
objMm1Protocol.Device    = "Falcom SAMBA 75 GSM/GPRS Modem"        ' Set GSM/GPRS modem

' MMS Connection: Load provider properties
objMm1Protocol.ProviderLoadConfig( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Mms\Mm1\UK\Vodafone.mm1" )

' MMS Connection: Connect
objMm1Protocol.Connect()
If ( objMm1Protocol.LastError <> 0 ) Then
    WScript.Quit
End If

' MMS Connection: Send the MmsMessage, including one or more slides
objMm1Protocol.Send( objMmsMessage )

' MMS Connection: Disconnect
objMm1Protocol.Disconnect()
MM1: Receive MMS messages via a GPRS Modem
Set objMm1Protocol       = CreateObject ( "ActiveXperts.MmsProtocolMm1" )  ' Create a new instance of MmsProtocolMm1
Set objConstants         = CreateObject ( "ActiveXperts.MmsConstants" )    ' Create a new instance of MmsConstants

' MMS Connection: Set device
objMm1Protocol.Device    = "Falcom SAMBA 75 GSM/GPRS Modem"                ' Set GSM/GPRS modem

' MMS Connection: Load provider properties
objMm1Protocol.ProviderLoadConfig( "D:\ActiveXperts\SMS and MMS Toolkit\Providers\Mms\Mm1\UK\Vodafone.mm1" )

' MMS Connection: Receive all MMS message notifications
objMm1Protocol.Receive ()
If ( objMm1Protocol.LastError <> 0 ) Then
    WScript.Quit
End If

' MMS Connection: Connect
objMm1Protocol.Connect()
If ( objMm1Protocol.LastError <> 0 ) Then
    WScript.Quit
End If

' MMS Connection: Retrieve first message
Set objMmsMessage = objMm1Protocol.GetFirstMessage()

While ( objConnection.LastError = 0 )
    WScript.Echo "Received new MMS message from: " & objMmsMessage.From
    WScript.Echo "                 Subject     : " & objMmsMessage.Subject
   
    Set objMmsMessage = objMm1Protocol.GetNextMessage ()
 WEnd
 
' MMS Connection: Disconnect
objMm1Protocol.Disconnect()
MM4: Send an MMS message via SMTP
Set objMm4Protocol       = CreateObject ( "ActiveXperts.MmsProtocolMm4" )  ' Create a new instance of MmsProtocolMm4
Set objMmsMessage        = CreateObject ( "ActiveXperts.MmsMessage" )      ' Create a new instance of MmsMessage
Set objMmsSlide          = CreateObject ( "ActiveXperts.MmsSlide" )        ' Create a new instance of MmsSlide
Set objConstants         = CreateObject ( "ActiveXperts.MmsConstants" )    ' Create a new instance of MmsConstants

' MmsSlide: Add duration, attachments(s) and text(s)
objMmsSlide.Clear()
objMmsSlide.Duration     = 10                                      ' Display this screen for 10 seconds
objMmsSlide.AddAttachment( "logo.gif" )                            ' Add a multimedia attachment
objMmsSlide.AddText( "The ActiveXperts logo" )                     ' Add a description

' MmsMessage: Set properties
objMmsMessage.Clear()                                              ' Clear the message object (good practise)
objMmsMessage.Subject    = "My Message"                            ' Subject of the message
objMmsMessage.AddRecipient ( "+4412345678" )                       ' MMS recipient; phonenumbers and e-mail addresses allowed

' MmsMessage: Add slide
objMmsMessage.AddSlide( objMmsSlide )                              ' Add slide to the message; you can add multiple slides

' MMS Connection: Set provider settings
objMm4Protocol.ProviderHost = "mmsc.o2.uk"                         ' Provider's hostname
objMm4Protocol.ProviderPort = 25                                   ' Provider's TCP port
objMm4Protocol.ProviderAccount = "MM4"                             ' Provider login    (not required for all providers)
objMm4Protocol.ProviderPassword = "secret"                         ' Provider password (not required for all providers)

' MMS Connection: Send the MmsMessage, including one or more slides
objMm4Protocol.Send ( objMmsMessage )
MM7: Send an MMS message via HTML/SOAP
Set objMm7Protocol       = CreateObject ( "ActiveXperts.MmsProtocolMm7" )  ' Create a new instance of MmsProtocolMm7
Set objMmsMessage        = CreateObject ( "ActiveXperts.MmsMessage" )      ' Create a new instance of MmsMessage
Set objMmsSlide          = CreateObject ( "ActiveXperts.MmsSlide" )        ' Create a new instance of MmsSlide
Set objConstants         = CreateObject ( "ActiveXperts.MmsConstants" )    ' Create a new instance of MmsConstants

' MmsSlide: Add duration, attachments(s) and text(s)
objMmsSlide.Clear()
objMmsSlide.Duration     = 10                                      ' Display this screen for 10 seconds
objMmsSlide.AddAttachment( "logo.gif" )                            ' Add a multimedia attachment
objMmsSlide.AddText( "The ActiveXperts logo" )                     ' Add a description

' MmsMessage: Set properties
objMmsMessage.Clear()                                              ' Clear the message object (good practise)
objMmsMessage.Subject    = "My Message"                            ' Subject of the message
objMmsMessage.AddRecipient( "+4412345678",objConstants.asMMS_RECIPIENT_TO) ' MMS recipient; phonenumbers and e-mail allowed

' MmsMessage: Add slide
objMmsMessage.AddSlide( objMmsSlide )	                             ' Add slide to the message; you can add multiple slides

' MMS Connection: Set provider settings
objMm7Protocol.ProviderURL = "http://mmsc.o2.uk/mm7"               ' Provider's URL
objMm7Protocol.ProviderWebAccount  = "mm7"                         ' Provider login    (not required for all providers)
objMm7Protocol.ProviderWebPassword = "secret"                      ' Provider password (not required for all providers)

' MMS Connection: Send the MmsMessage, including one or more slides
objMm7Protocol.Send ( objMmsMessage )

16.2. Visual Basic .NET

Make sure that ActiveXperts SMS and MMS Toolkit is installed on your system. For details about installation, click here.

Add a reference to the object using the Visual Basic Solution Explorer:

You can create a new MmsConstants object in the following way:

Imports AXmsCtrl
...
Dim objConstants As MmsConstants = New MmsConstants()

If you use a GPRS modem (or GPRS phone) to send MMS messages, create a new MmsProtocolMm1 object in the following way:

Imports AXmsCtrl
...
Dim objConnection As MmsProtocolMm1 = New MmsProtocolMm1()

If you use SMTP to send MMS messages, create a new MmsProtocolMm4 object in the following way:

Imports AXmsCtrl
...
Dim objConnection As MmsProtocolMm4 = New MmsProtocolMm4()

If you use HTTP/SOAP to send MMS messages, create a new MmsProtocolMm7 object in the following way:

Imports AXmsCtrl
...
Dim objConnection As MmsProtocolMm7 = New MmsProtocolMm7()

Create a new MmsMessage object in the following way:

Imports AXmsCtrl
...
Dim objMessage As MmsMessage = New MmsMessage()

Create a new MmsSlide object in the following way:

Imports AXmsCtrl
...
Dim objSlide As MmsSlide = New MmsSlide()

After these declarations and creation of the object(s), you can use the objects in your Visual Basic .NET projects.

16.3. Visual C# .NET

Make sure that ActiveXperts SMS and MMS Toolkit is installed on your system.

Add a reference to the object using the Visual C# Solution Explorer:

You can create a new MmsConstants object in the following way:

using AXmsCtrl;
...
MmsConstants objConstants = new MmsConstants();

If you use a GPRS modem (or GPRS phone) to send MMS messages, create a new MmsProtocolMm1 object in the following way:

using AXmsCtrl;
...
MmsProtocolMm1 objMm1Protocol = new MmsProtocolMm1();            

If you use SMTP to send MMS messages, create a new MmsProtocolMm4 object in the following way:

using AXmsCtrl;
...
MmsProtocolMm4 objMm4Protocol = new MmsProtocolMm4();

If you use HTTP/SOAP to send MMS messages, create a new MmsProtocolMm7 object in the following way:

using AXmsCtrl;
...
MmsProtocolMm7 objMm7Protocol = new MmsProtocolMm7();

Create a new MmsMessage object in the following way:

using AXmsCtrl;
...
MmsMessage objMmsMessage = new MmsMessage();

Create a new MmsSlide object in the following way:

using AXmsCtrl;
...
MmsSlide objMmsSlide = new MmsSlide();

After these declarations and creation of the object(s), you can use the objects inside your Visual C# .NET code.

16.4. Visual Basic

Make sure that ActiveXperts SMS and MMS Toolkit is installed on your system.

ActiveXperts SMS and MMS Toolkit can be used in Visual Basic 5.x or higher. In Visual Basic, go to the 'Project/References...' menu item and check the box next to 'ActiveXperts SMS and MMS Toolkit' Type Library. Now, you can declare and create MMS objects.

You can create a new MmsConstants object in the following way:

Dim objConstants As AXmsCtrl.MmsConstants                                  ' Declaration              
Set objConstants = CreateObject( "ActiveXperts.MmsConstants" )             ' Creation

If you use a GPRS modem (or GPRS phone) to send MMS messages, create a new MmsProtocolMm1 object in the following way:

Dim objMm1Protocol As AXmsCtrl.MmsProtocolMm1                              ' Declaration              
Set objMm1Protocol = CreateObject( "ActiveXperts.MmsProtocolMm1" )         ' Creation

If you use SMTP to send MMS messages, create a new MmsProtocolMm4 object in the following way:

Dim objMm4Protocol As AXmsCtrl.MmsProtocolMm4                              ' Declaration              
Set objMm4Protocol = CreateObject( "ActiveXperts.MmsProtocolMm4" )         ' Creation

If you use HTTP/SOAP to send MMS messages, create a new MmsProtocolMm7 object in the following way:

Dim objMm7Protocol As AXmsCtrl.MmsProtocolMm7                              ' Declaration              
Set objMm7Protocol = CreateObject( "ActiveXperts.MmsProtocolMm7" )         ' Creation

Create a new MmsMessage object in the following way:

Dim objMmsMessage As AXmsCtrl.MmsMessage                                   ' Declaration              
Set objMmsMessage = CreateObject( "ActiveXperts.MmsMessage" )              ' Creation
Create a new MmsSlide object in the following way:
Dim objMmsSlide As AXmsCtrl.MmsSlide                                       ' Declaration              
Set objMmsSlide = CreateObject( "ActiveXperts.MmsSlide" )                  ' Creation

After these declarations and creation of the object(s), you can use the objects in your Visual Basic projects.

16.5. Visual C++

Make sure that ActiveXperts SMS and MMS Toolkit is installed on your system.

ActiveXperts SMS and MMS Toolkit can be used in Visual C++ projects. Include the *.h and *.c file provided by ActiveXperts to bind your code to the MMS component. These files are located in the Include directory of the Visual C++ samples directory. These are the files:

You can create a new MmsConstants object in the following way:

IMmsConstants       *pMmsConstants;                    // Declaration
CoCreateInstance(CLSID_MmsConstants, NULL, CLSCTX_INPROC_SERVER, IID_IMmsConstants, (void**) &pMmsConstants);

If you use a GPRS modem (or GPRS phone) to send MMS messages, create a new MmsProtocolMm1 object in the following way:

IMmsProtocolMm1     *pMm1Protocol;                     // Declaration
CoCreateInstance(CLSID_MmsProtocolMm1, NULL, CLSCTX_INPROC_SERVER, IID_IMmsProtocolMm1, (void**) &pMm1Protocol);

If you use SMTP to send MMS messages, create a new MmsProtocolMm4 object in the following way:

IMmsProtocolMm4     *pMm4Protocol;                     // Declaration
CoCreateInstance(CLSID_MmsProtocolMm4, NULL, CLSCTX_INPROC_SERVER, IID_IMmsProtocolMm4, (void**) &pMm4Protocol);

If you use HTTP/SOAP to send MMS messages, create a new MmsProtocolMm7 object in the following way:

IMmsProtocolMm7     *pMm7Protocol;                     // Declaration
CoCreateInstance(CLSID_MmsProtocolMm7, NULL, CLSCTX_INPROC_SERVER, IID_IMmsProtocolMm7, (void**) &pMm7Protocol);

Create a new MmsMessage object in the following way:

IMmsMessage         *pMmsMessage;                      // Declaration
CoCreateInstance(CLSID_MmsMessage, NULL, CLSCTX_INPROC_SERVER, IID_IMmsMessage, (void**) &pMmsMessage);

Create a new MmsSlide object in the following way:

IMmsSlide           *pMmsSlide;                        // Declaration
CoCreateInstance(CLSID_MmsSlide, NULL, CLSCTX_INPROC_SERVER, IID_IMmsSlide, (void**) &pMmsSlide);

16.6. Delphi 6.x or higher

Make sure that ActiveXperts SMS and MMS Toolkit is installed on your system. For details about installation, click here.

First, add a reference to the MMS Toolkit objects:

You can create a new MmsConstants object in the following way:

MmsConstants   : TMmsConstants;                        ' Declaration of the wrapper class
objConstants   : IMmsConstants;                        ' Declaration of the interface class
objConstants   := MmsConstants.DefaultInterface;       ' Creation new instance of the object

If you use a GPRS modem (or GPRS phone) to send MMS messages, create a new MmsProtocolMm1 object in the following way:

MmsProtocolMm1 : TMmsMm1Protocol;                      ' Declaration of the wrapper class
objMm1Protocol : IMmsProtocolMm1;                      ' Declaration of the interface class
objMm1Protocol := MmsProtocolMm1.DefaultInterface;     ' Creation new instance of the object

If you use SMTP to send MMS messages, create a new MmsProtocolMm4 object in the following way:

MmsProtocolMm4 : TMmsMm4Protocol;                      ' Declaration of the wrapper class
objMm4Protocol : IMmsProtocolMm4;                      ' Declaration of the interface class
objMm4Protocol := MmsProtocolMm4.DefaultInterface;     ' Creation new instance of the object

If you use HTTP/SOAP to send MMS messages, create a new MmsProtocolMm7 object in the following way:

MmsProtocolMm7 : TMmsMm7Protocol;                      ' Declaration of the wrapper class
objMm7Protocol : IMmsProtocolMm7;                      ' Declaration of the interface class
objMm7Protocol := MmsProtocolMm7.DefaultInterface;     ' Creation new instance of the object

Create a new MmsMessage object in the following way:

MmsMessage     : TMmsMessage;                          ' Declaration of the wrapper class
objMessage     : IMmsMessage;                          ' Declaration of the interface class
objMessage     := MmsMessage.DefaultInterface;         ' Creation new instance of the object

Create a new MmsSlide object in the following way:

MmsSlide         : TMmsSlide;                            ' Declaration of the wrapper class
objSlide         : IMmsSlide;                            ' Declaration of the interface class
objSlide         := MmsSlide.DefaultInterface;           ' Creation new instance of the object

After these declarations and creation of the object(s), you can use the objects in your Delphi projects.

16.7. ASP 2.x environment

Simply create the objects in the following way:

<html>
<body>
Version:
<script language=vbscript runat=server>
  Set objMmsConstants  = CreateObject( "ActiveXperts.MmsConstants" )
  Set objMm1Protocol   = CreateObject( "ActiveXperts.MmsProtocolMm1" )
  Set objMm4Protocol   = CreateObject( "ActiveXperts.MmsProtocolMm4" )
  Set objMm7Protocol   = CreateObject( "ActiveXperts.MmsProtocolMm7" )
  Set objMmsMessage    = CreateObject( "ActiveXperts.MmsMessage" )
  Set objMmsSlide      = CreateObject( "ActiveXperts.MmsSlide" )
  ....
  Response.Write objMm1Protocol.Version
  ....
</script>
</body>
</html>

17. MMS Constants

In SMS and MMS Toolkit, all MMS constants are grouped together in a separate object called MmsConstants. You must first create the MmsConstants object before you can actually use the constants:

Set objMmsConstants = CreateObject( "ActiveXperts.MmsConstants" )
WScript.Echo objMmsConstants.asMMS_CLASS_PERSONAL
WScript.Echo objMmsConstants.asMMS_CLASS_ADVERTISEMENT
...

17.1. Message Recipient Types

Name Description
asMMS_RECIPIENT_TO TO recipient (default)
asMMS_RECIPIENT_CC CC recipient
asMMS_RECIPIENT_BCC BCC recipient

17.2. Message Class Types

Name Description
asMMS_CLASS_PERSONAL A phone-to-phone MMS message. One user sending a personal message to another user
asMMS_CLASS_ADVERTISEMENT The MMS message is an advert. Users who have switched off advertisement MMS messages won't receive this type of messages
asMMS_CLASS_INFORMATIONAL The MMS message is informational. Users who have switched off informational MMS messages won't receive this type of messages
asMMS_CLASS_AUTO The class of MMS message is automatically set by the provider, i.e. the provider default is used

17.3. Message Priority Types

Name Description
asMMS_PRIORITY_LOW Low priority MMS message
asMMS_PRIORITY_NORMAL Normal priority MMS message
asMMS_PRIORITY_HIGH High priority MMS message

17.4. Digital Rights Managent Types

Name Description
asMMS_DRM_FORWARDLOCK Most basic level of DRM. When "Forward Lock" is enabled, this indicates that the receiving device should not allow any non-text objects in the message to be forwarded off of the device
asMMS_DRM_PLAY Permission to play the MMS message
asMMS_DRM_DISPLAY Permission to display the MMS message
asMMS_DRM_EXECUTE Permission to execute the MMS message

17.5. MMS File Types

Name Description
asMMS_MM1FILE_MSENDREQ Save MMS file in submit format (Client to MMSC)
asMMS_MM1FILE_MRETRIEVECONF Save MMS file in deliver format (MMSC to Client)

17.6. MM7 Protocol Variation Types

Name Description
asMMS_MM7VARIATION_3GPP Use 3GPP MM7 standard for sending MMS using SOAP
asMMS_MM7VARIATION_ERICSSON Use Ericsson MM7 standard for sending MMS using SOAP
asMMS_MM7VARIATION_PAP Use PAP MM7 standard for sending MMS using SOAP

17.7. MMS 3GPP Protocol Version Types

Name Description
asMMS_VERSION_5_2_0 Use 3GPP version 5.2.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_3_0 Use 3GPP version 5.3.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_4_0 Use 3GPP version 5.4.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_5_0 Use 3GPP version 5.5.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_6_0 Use 3GPP version 5.6.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_7_0 Use 3GPP version 5.7.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_8_0 Use 3GPP version 5.8.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_9_0 Use 3GPP version 5.9.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_10_0 Use 3GPP version 5.10.0 for sending MMS using MM4 or MM7
asMMS_VERSION_5_11_0 Use 3GPP version 5.11.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_0_0 Use 3GPP version 6.0.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_1_0 Use 3GPP version 6.1.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_2_0 Use 3GPP version 6.2.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_3_0 Use 3GPP version 6.3.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_4_0 Use 3GPP version 6.4.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_5_0 Use 3GPP version 6.5.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_6_0 Use 3GPP version 6.6.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_7_0 Use 3GPP version 6.7.0 for sending MMS using MM4 or MM7
asMMS_VERSION_6_8_0 Use 3GPP version 6.8.0 for sending MMS using MM4 or MM7

17.8. MM7 XML Schema Types

Name Description
asMMS_SCHEMA_REL5_MM7_1_0 Use REL5_MM7_1_0 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_1 Use REL5_MM7_1_1 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_2 Use REL5_MM7_1_2 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_3 Use REL5_MM7_1_3 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_4 Use REL5_MM7_1_4 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_5 Use REL5_MM7_1_5 XML MM7 Schema
asMMS_SCHEMA_REL6_MM7_1_0 Use REL6_MM7_1_0 XML MM7 Schema
asMMS_SCHEMA_REL6_MM7_1_1 Use REL6_MM7_1_1 XML MM7 Schema
asMMS_SCHEMA_REL6_MM7_1_2 Use REL6_MM7_1_2 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_3 Use REL6_MM7_1_3 XML MM7 Schema
asMMS_SCHEMA_REL5_MM7_1_4 Use REL6_MM7_1_4 XML MM7 Schema

17.9. MMS Storage Types

Name Description
asSTORAGE_ALL Use all available memory storage locations (default)
asSTORAGE_SIM Use SIM Memory
asSTORAGE_DEVICE Use Device Memory
asSTORAGE_COMBINED Use SIM and device memory

18. MmsMessage and MmsSlide objects

18.1. Introduction

The MmsSlide object holds all information about a single MMS slide. A slide is a set of multimedia items and descriptions.
You can think of a slide that consists of two pictures and a small plain-text explanation. A slide can be added to an MmsMessage object. You can add multiple MMS slides to a single MMS message. The MmsMessage object should contain at least one MMS slide in order to send it out through an MM1, MM4 or MM7 connection.

The following sample shows how create a slide with two pictures and a small plain-text description:

Set objMmsSlide          = CreateObject ( "ActiveXperts.MmsSlide" )        ' Create a new MmsSlide instance

' MmsSlide: Add duration, attachments(s) and text(s)
objMmsSlide.Duration     = 10                                              ' Display this screen for 10 seconds
objMmsSlide.AddAttachment( "c:\my pictures\picture1.jpg" )                 ' Add a new picture
objMmsSlide.AddAttachment( "c:\my pictures\picture2.jpg" )                 ' Add another picture
objMmsSlide.AddText( "The ActiveXperts logo" )                             ' Add description

In order to send the slide as part of an MMS message, you must first add the slide to a message, like this:

Set objMmsSlide          = CreateObject ( "ActiveXperts.MmsSlide" )        ' Create a new MmsSlide instance
Set objMmsMessage        = CreateObject ( "ActiveXperts.MmsMessage" )      ' Create a new MmsMessage instance
...
objMmsSlide.AddAttachment( ... )
...
objMmsMessage.AddSlide( objMmsSlide )                                      ' Add slide to message; multiple slides allowed

The MmsMessage object holds all information a new outgoing MMS message. The MmsMessage object should contain at least one MMS slide in order to send it out through an MM1, MM4 or MM7 connection.

Finally, you want to send the MMS message, containing the slide(s), like this:

Set objMm1Protocol       = CreateObject( "ActiveXperts.MmsProtocolMm1" )   ' Create a new MmsProtocolMm1 instance
Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )         ' Create a new MmsSlide instance
Set objConstants         = CreateObject( "ActiveXperts.MmsConstants" )     ' Create a new MmsConstants instance

' MmsSlide: Add duration, attachments(s) and text(s)
objMmsSlide.Clear()
objMmsSlide.Duration     = 10                                              ' Display this screen for 10 seconds
objMmsSlide.AddAttachment( "logo.gif" )                                    ' Add a multimedia attachment
objMmsSlide.AddText( "The ActiveXperts logo" )                             ' Add a description

' MmsMessage: Set properties
objMmsMessage.Clear()                                                      ' Clear the message object (good practise)
objMmsMessage.Subject    = "My Message"                                    ' Subject of the message
objMmsMessage.AddRecipient("+4412345678",objConstants.asMMS_RECIPIENT_TO)  ' MMS recipient; phonenumbers/e-mail allowed

' MmsMessage: Add slide
objMmsMessage.AddSlide( objMmsSlide )                                      ' Add slide to message; multiple slides allowed

' MMS Connection: Set properties
NOTE: You can find settings for various providers all over the world here: www.activexperts.com/xmstoolkit/mmsclist
objMm1Protocol.Device = "Falcom SAMBA 75 GSM/GPRS Modem"                   ' Set GSM/GPRS modem
objMm1Protocol.ProviderAPN = "MMS"                                         ' Provider's Access Point Name
objMm1Protocol.ProviderAPNAccount = ""                                     ' Provider login (not required for all providers)
objMm1Protocol.ProviderAPNPassword = ""                                    ' Provider login (not required for all providers)
objMm1Protocol.ProviderWAPGateway  = "10.250.255.183"                      ' Provider's WAPgateway address
objMm1Protocol.ProviderMMSC = "http://mms.orange.nl:8002/"                 ' Provider's MMS Server Provider Center address

' MMS Connection: Connect
objMm1Protocol.Connect()                                                   ' Connect
If ( objMm1Protocol.LastError <> 0 ) Then
   WScript.Quit
End If

' MMS Connection: Send the MmsMessage, including one or more slides
objMm1Protocol.Send ( objMmsMessage )                                      ' Send the MmsMessage, incl. one or more slides

objMm1Protocol.Disconnect()                                                ' Disconnect

18.2. MmsSlide Object - Overview of Properties and Functions

Property In/Out Mand/Opt Description
Duration number In/Out O Duration of the slide, in seconds
LastError Number Out n/a Result of the last called function

Function Description
Clear Clear all properties
AddAttachment Add a new multimedia attachment
AddText Add a new text description
GetErrorDescription Lookup error description of the given error code

18.2.1. MmsSlide Object - Properties

MmsSlide.Duration property

Type:

Number

Description:

Duration - in seconds - that a slide will be displayed on the remote users device. Default: 10 seconds.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )         ' Create a new MmsSlide instance
objMmsSlide.Duration     = 10                                              ' Display this screen for 10 seconds
...
...

MmsSlide.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )       ' Create a new MmsSlide instance
objMmsSlide.AddAttachment( "C:\Temp\File1.jpg" )                         ' Add an image file as attachment
WScript.Echo "LastError: " & objMmsSlide.LastError                       ' Show the result of 'AddAttachment'

18.2.2. MmsSlide Functions

MmsSlide.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )       ' Create a new MmsSlide instance
objMmsSlide.Duration     = 5                                           
objMmsSlide.Clear()                                                      ' Clear properties
WScript.Echo objMmsSlide.Duration                                        ' Default duration (10) will be displayed

MmsSlide.AddAtachment function

Description:

This function adds a new multimedia file to the slide.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )       ' Create a new MmsSlide instance
objMmsSlide.AddAttachment( "C:\Temp\File1.jpg" )                         ' Add a multimedia file
WScript.Echo "LastError: " & objMmsSlide.LastError                       ' Show the result of 'AddAttachment

MmsSlide.AddText function

Description:

This function adds a new text description file to the slide.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )       ' Create a new MmsSlide instance
objMmsSlide.AddText( "Hello, world!" )                                   ' Add a text description
WScript.Echo "LastError: " & objMmsSlide.LastError                       ' Show the result of 'AddText'

MmsSlide.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )       ' Create a new MmsSlide instance
objMmsSlide.AddAttachment( "C:\Temp\File1.jpg" )                         ' Add a multimedia file
WScript.Echo "LastError: " & objMmsSlide.LastError & _                   ' Show the result of 'AddText'
             objMmsSlide.GetErrorDescription( objMmsSlide.LastError )    ' Show the verbose result of 'AddText

18.3. MmsMessage Object - Overview of Properties and Functions

Property Type In/Out Mand/Opt Description
From String In/Out O E-mail address, phone number or IP address of the originator
Class Number In/Out O Message class
ValidityPeriod Number In/Out O Retry time (in minutes)
Priority Number In/Out O Message priority (low, normal or high)
Subject String In/Out O Subject of the message
LastError Number Out n/a Result of the last called function

Function Description
Clear Clear all properties
AddRecipient Add a new recipient
AddSlide Add a new slide to the message
LoadFromFile Load a message from file into memory
SaveToFile Save the message into a single file
GetErrorDescription Lookup error description of the given error code

18.3.1. MmsMessage Object - Properties

MmsMessage.From property

Type:

String

Description:

Phone number, e-mail address or IP number of the sender. If the field is left blank, the provider will assign the sender address automatically.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
objMmsMessage.From       = "+31625044454"                                  ' Set sender address
...

MmsMessage.Class property

Type:

Number

Description:

The message class is primarily indended for the remote recipient, to handle different types of messages different. Valid values are: asMMS_CLASS_PERSONAL, asMMS_CLASS_ADVERTISEMENT, asMMS_CLASS_INFORMATIONAL and asMMS_CLASS_AUTO.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
Set objMmsConstants      = CreateObject( "ActiveXperts.MmsConstants" )     ' Create Constants instance

objMmsMessage.Class      = objMmsConstants.asMMS_CLASS_INFORMATIONAL       ' Set message class to 'informational'
...

MmsMessage.ValidityPeriod property

Type:

Number

Description:

Specifies the preferred retry time, in minutes. Only applies to outgoing MM1 and MM7 MMS messages. The retry time is used by the GSM operator. When a message cannot be delivered to the recipient (for instance because the remote GSM phone is switched off), the operator will try to resend the message for a maximum of 'ValidityPeriod' minutes. After that, the message fails.
If 0 (default value) is specified, the default retry time of the operator is used.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create MmsMessage instance
Set objMm1Protocol       = CreateObject( "ActiveXperts.MmsProtocolMm1" )

objMmsMessage.Recipient  = "+31624896641"                   
objMsMessage.ValidityPeriod = 10                                           ' When message fails, operator will retry for 
                                                                           ' a maximum of 10 minutes
objMm1Protocol.Send( objMmsMessage )                                       ' Send the MMS message

MmsMessage.Priority property

Type:

Number

Description:

The message priority determines the priority of the message, and is primarily indended for the remote recipient, to have get different tpyes of indication for new incoming messages. Valid values are: asMMS_PRIORITY_LOW, asMMS_PRIORITY_NORMAL and asMMS_PRIORITY_HIGH.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
Set objMmsConstants      = CreateObject( "ActiveXperts.MmsConstants" )     ' Create Constants instance
objMmsMessage.Priority   = objMmsConstants.asMMS_PRIORITY_HIGH

MmsMessage.Subject property

Type:

String

Description:

The subject of the MMS message.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
objMmsMessage.Subject    = "My MMS message to you"                         ' Set subject

MmsMessage.LastError property

Type:

Number

Description:

The result of a previously called function. Should be used to check the result of your last function call. All functions (methods) store the result into the 'LastError' property. The property is read-only; you cannot assign a value to it.

For more information about error codes, click here.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create a new MmsMessage instance
...
objMmsMessage.AddSlide( ... )
WScript.Echo "LastError: " & objMmsMessage.LastError                       ' Show the result of 'AddSlide'

18.3.2. MmsMessage functions

MmsMessage.Clear function

Description:

This function resets all Properties to the initial, default values.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" ) ' Create MmsMessage instance
objMmsMessage.From       = "+314412345678"
...
objMmsMessage.Clear()                                                ' Clear all properties

MmsMessage.AddRecipient function

Description:

This function adds a new recipient or (blind) carbon copy recipient to the message. Two types of MMS recipients are supported:

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create MmsMessage instance
Set objConstants         = CreateObject( "ActiveXperts.MmsConstants" )     ' Create Constants instance
objMmsMessage.AddRecipient("+4412345678",objConstants.asMMS_RECIPIENT_TO)  ' Recipient in the UK, a mobile number
objMmsMessage.AddRecipient("+4412345679",objConstants.asMMS_RECIPIENT_CC)  ' CC recipient in the UK, a mobile number
objMmsMessage.AddRecipient("me@zyx.org",objConstants.asMMS_RECIPIENT_BCC)  ' BCC recipient, an e-mail address

MmsMessage.AddSlide function

Description:

This function adds a slide to a message.

Parameters:

Return value:

Always 0. Check LastError property to see if the function was completed successfully.

Example:

Set objMm1Protocol       = CreateObject( "ActiveXperts.MmsProtocolMm1" )
Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create MmsMessage instance
Set objMmsSlide          = CreateObject( "ActiveXperts.MmsSlide" )
...
objMmsSlide.Duration     = 10          
objMmsSlide.AddAttachment( "logo.gif" )
objMmsSlide.AddText( "The ActiveXperts logo" )
objMmsMessage.AddSlide( objMmsSlide )                                      ' Add slide to the message
...
objConnection.Connect ()
objConnection.Send( objMmsMessage )
...

MmsMessage.SaveToFile function

Description:

With SaveToFile, you can save an MMS message (including all slides) that was so it can be used by a third party application, or by the 'LoadFromFile' function.

Parameters:

Return value:

Check LastError property to see if the function was completed successfully.

Example:

Set objConstants         = CreateObject ( "ActiveXperts.MmsConstants" )
Set objMmsMessage        = CreateObject ( "ActiveXperts.MmsMessage" )      ' Create MmsMessage instance
Set objMmsSlide          = CreateObject ( "ActiveXperts.MmsSlide" )
...
objMmsSlide.Duration     = 10                                              
objMmsSlide.AddAttachment( "logo.gif" )
objMmsSlide.AddText( "The ActiveXperts logo" )
...
objMmsMessage.AddSlide( objMmsSlide )                                      
objMmsMessage.SaveToFile("C:\File.mms",objConstants.asMMS_MM1FILE_MSENDREQ) ' Save message incl. slide(s)
...	

MmsMessage.LoadFromFile function

Description:

With LoadFromFile, you can load an MMS message (including all slides) that was created by a third party application, or by the 'SaveToFile' function.

Parameters:

Return value:

Check LastError property to see if the function was completed successfully.

Example:

Set objMm1Protocol       = CreateObject( "ActiveXperts.MmsProtocolMm1" )
Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create MmsMessage instance
...
objMmsMessage.Clear                                                        ' Clear message, incl. all slides
objMmsMessage.LoadFromFile( "C:\File.mms" )                                ' Load message incl. slides 
...
objMm1Protocol.Send( objMmsMessage )

MmsMessage.GetErrorDescription function

Description:

Function to retrieve the explanation of an error code.

Parameters:

Return value:

The error string.

Example:

Set objMmsMessage        = CreateObject( "ActiveXperts.MmsMessage" )       ' Create MmsMessage instance
objMmsMessage.AddRecipient( "+31625044454" )
If objMmsMessage.LastError <> 0 Then
  WScript.Echo "Error description: " & objobjMMS