Modified:
30/11/2005
Application ID: #5809
Option Explicit
Dim objSmpp
Dim objConstants
Dim i
Set objSmpp = CreateObject ( "ActiveXperts.Smpp" )
Set objConstants = CreateObject ( "ActiveXperts.SmsConstants" )
Wscript.Echo "ActiveXperts SMS and Pager Toolkit " & objSmpp.Version & " demo."
Wscript.Echo "Expiration date: " & objSmpp.ExpirationDate & vbCrLf
' Set server properties
objSmpp.Server = "smpp.activexperts-labs.com"
objSmpp.ServerPort = 2775
objSmpp.SystemID = "AX005"
objSmpp.SystemPassword = "812056"
objSmpp.SystemType = "SMPP"
objSmpp.ServerTimeout = 3000
objSmpp.SystemMode = objConstants.asSMPPMODE_TRANSMITTER
' Set Logfile
objSmpp.LogFile = "c:\SmppLog_vbs.txt"
' Connect SMPP provider
objSmpp.Connect
If objSmpp.IsConnected = True Then
WScript.Echo "Connected to provider"
Do
objSmpp.MessageRecipient = inputbox( "Enter the recipients phone number." & vbCrLf & "( Use international number format. )", "Enter Recipient Number", "+31647134225")
Loop until objSmpp.MessageRecipient <> "" ' Set recipient
objSmpp.MessageData = "ActiveXperts Test Message" ' Set message text
objSmpp.MessageType = objConstants.asMESSAGETYPE_TEXT
objSmpp.ValidityPeriod = 60 ' Set Validity period ( in minutes )
WScript.Echo "Sending the message..."
objSmpp.Send ' Send the message
End If
' Show the result
If( objSmpp.LastError <> 0 ) Then
WScript.Echo "Failed to send message, error: " & objSmpp.LastError & " (" & objSmpp.GetErrorDescription( objSmpp.LastError ) & ")"
WScript.Echo "To view the trace file, open " & objSmpp.LogFile & "."
Else
WScript.Echo "Message successfully submitted" & vbCrLf & vbCrLf & "Message ID : " & objSmpp.MessageReference
End If
objSmpp.Disconnect ' Disconnect
WScript.Echo "Disconnected."
License Information
Direct link: