You are here:
ActiveXperts.com > SMS and MMS Toolkit > How to Use MMS Toolkit > GSM/GPRS (MM1) > VBScript
Quicklinks
The SMS and MMS Toolkit is a software development kit (SDK) to enhance an application or script with SMS, MMS and Pager functionality. SMS messages can be sent using a GSM/GPRS modem, an SMPP provider, an HTTP compliant SMS provider or using a standard dialup or fixed-line SMS modem. MMS messages can be sent via a GSM/GPRS modem (MM1), an SMTP server (MM4) or an XML/SOAP compliant provider (MM7).
SMS features:
MMS features:
Pager features:
This document describes how the SMS and MMS Toolkit can be integrated into VBScript projects.
Download the SMS and MMS Toolkit 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 script to send MMS using MMS Toolkit.
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 SMS and MMS Toolkit objects:
Dim objMm1Protocol Dim objMmsMessage Dim objMmsConstants Dim objMmsSlide
Create the MMS objects like this:
Set objMm1Protocol = CreateObject( "ActiveXperts.MmsProtocolMm1" ) Set objMmsMessage = CreateObject( "ActiveXperts.MmsMessage" ) Set objMmsConstants = CreateObject( "ActiveXperts.MmsConstants" ) Set objMmsSlide = CreateObject( "ActiveXperts.MmsSlide" )
Now, add the following lines to the file to have your fist MMS Toolkit VBScript program:
WScript.Echo "Version: " & objMm1Protocol.Version WScript.Echo "Expiration Date: " & objMm1Protocol.ExpirationDate
You can now send MMS messages.
The following VBScript code shows how to send a MMS message using a GSM/GPRS or UMTS phone or modem:
Option Explicit Dim objMmsConstants Dim objMmsMessage Dim objMm1Protocol Dim objMmsSlide Set objMmsConstants = CreateObject ( "ActiveXperts.MmsConstants" ) Set objMmsMessage = CreateObject ( "ActiveXperts.MmsMessage" ) Set objMm1Protocol = CreateObject ( "ActiveXperts.MmsProtocolMm1" ) Set objMmsSlide = CreateObject ( "ActiveXperts.MmsSlide" ) ' Set message properties objMmsMessage.Clear objMmsMessage.Subject = "MMS Message" objMmsMessage.AddRecipient "+31647134225" ' Advanced message properties objMmsMessage.Class = objMmsConstants.asMMS_CLASS_PERSONAL objMmsMessage.Priority = objMmsConstants.asMMS_PRIORITY_HIGH ' Add MMS Slide objMmsSlide.Duration = 10 'Display this screen for 10 seconds objMmsSlide.AddAttachment "logo.gif" objMmsSlide.AddText "MMS Message from ActiveXperts SMS and MMS Toolkit" objMmsMessage.AddSlide ( objMmsSlide ) ' Set Windows Telephony device ( must be a GPRS modem with SIM card inserted and PIN removed ) objMm1Protocol.Device = "Standard 33600 bps Modem" objMm1Protocol.LogFile = "mmslog.txt" 'Server settings: GPRS APN, WAP Gateway and MMSC Server Address, please ask your provide for these settings 'or have a look at http://www.activexperts.com/xmstoolkit/mmsclist objMm1Protocol.ProviderAPN = "MMS" objMm1Protocol.ProviderWAPGateway = "10.250.255.183" objMm1Protocol.ProviderMMSCAddress = "http://mms.orange.nl:8002/" 'Connect to Server objMm1Protocol.Connect If ( objMm1Protocol.LastError <> 0 ) Then WScript.Echo objMm1Protocol.GetErrorDescription ( objMm1Protocol.LastError ) WScript.Quit End If objMm1Protocol.Send ( objMmsMessage ) WScript.Echo objMm1Protocol.GetErrorDescription ( objMm1Protocol.LastError ) WScript.Echo objMm1Protocol.ProviderResponse objMm1Protocol.Disconnect WScript.Echo "Ready..."
There are many working samples included with the product. You can also find them on the ActiveXperts FTP site: ftp.activexperts-labs.com/samples/mobile-messaging-component.