Quicklinks
SMS Messaging Server is an SMS messaging framework that enables companies to send, receive and process SMS- and e-mail messages. The framework is designed support virtually any scenario where low-and high volume SMS messaging is required. Use SMS Messaging Server in the following scenarios:
SMS Messaging Server can be well integrated into VBScript environments. This document describes how the SMS Messaging Server can be integrated into VBScript projects.
Download ActiveXperts SMS Messaging Server from the ActiveXperts Download Site and start the installation. The installation guides you through the installation process.
Create a new script using your favorite editor. You can simply use notepad. However, a VBScript editor is recommended, so you can browse through objects, objects properties and object functions.
You're now able to write a more advanced VBScript program to create new messages.
Create a new VBScript file called DEMO.VBS. It is recommended to insert the following line on top of your code:
Option Explicit
This statement requires that all variable names be defined (with the Dim statement), to avoid simple typos that can cause incredible headaches and long debugging sessions for something that should have never happened.
Now, declare the MessageDB and Constants objects:
Dim objMessageDB Dim objMessage Dim objConstants
Create the MessageDB and Constants objects:
Set objMessageDB = CreateObject( "AxMmServer.MessageDB" ) Set objConstants = CreateObject( "AxMmServer.Constants" )
You should not create an instance of a Message yourself; it is returned by functions like Create, FindFirstMessage, FindNextMessage and Load.
You can now send SMS and/or e-mail messages.
The following VBScript code shows how to send an SMS message:
Option Explicit Dim objMessageDB, objMessage, objConstants Dim numRecordID, strRecipient ' Create objects Set objMessageDB = CreateObject( "AxMmServer.MessageDB" ) Set objConstants = CreateObject( "AxMmServer.Constants" ) ' Open the Database objMessageDB.Open WScript.Echo "Open, result: " & objMessageDB.LastError If( objMessageDB.LastError <> 0 ) Then WScript.Quit End If ' Create new Message in the Message Database Set objMessage = objMessageDB.Create WScript.Echo "Create, result: " & objMessageDB.LastError If( objMessageDB.LastError = 0 ) Then WScript.Echo "ID of the new message: " & objMessage.ID ' Modify the Message objMessage.Direction = objConstants.MESSAGEDIRECTION_OUT objMessage.Type = objConstants.MESSAGETYPE_SMS objMessage.Status = objConstants.MESSAGESTATUS_PENDING objMessage.ChannelID = 0 ' Any available channel capable of handling this message objMessage.ScheduledTime = "" 'Immediate send objMessage.Recipient = "+31625044454" objMessage.Body = "SMS Messaging Server - VBScript Test SMS" ' Save the Message objMessageDB.Save objMessage WScript.Echo "Save, result: " & objMessageDB.LastError End If ' Close the database objMessageDB.Close WScript.Echo "Message Dastabase closed." WScript.Echo "Ready."