In past postings, we’ve provided a variety of command line script examples that make it easy to interface with NowSMS from a command line interface.
The original command line interface, designed to send standard text messages can be found at the following link: http://www.nowsms.com/sending-sms-from-command-line
A script to enable sending MMS messages from a command line interface was published at the following link: http://www.nowsms.com/sending-mms-from-the-command-line
And a script to enable sending OMA Client Provisioning Content (XML Settings) was published at the following link: http://www.nowsms.com/send-oma-client-provisioning-ota-xml-settings-from-the-command-line
All of these scripts can be executed from a standard command line interface, making it easy to interface with NowSMS from a variety of different environments.
However, suppose you want to send WAP push messages or other types of binary SMS messages from a command line interface? It is relatively easy to adapt the other examples for this purpose, but we decided to provide an example to make it even easier.
Download the Windows script file sms2.js from http://www.nowsms.com/download/sms2.js.txt. (Right click and save this file as sms2.js.)
Assuming that the script file is saved as a file named sms2.js, you would issue the following command:
cscript sms2.js PhoneNumber1[,PhoneNumber2,...] NowSMSURLParameter1=Value1 [NowSMSURLParameter2=Value2] [NowSMSURLParameterN=ValueN]
(cscript.exe is the Windows Script Host, which is a component of Windows which should be located in the \Windows\System32 directory.)
NowSMSURLParameter1=Value1 can be any of the URL parameters documented for NowSMS at http://www.nowsms.com/doc/submitting-sms-messages/url-parameters.
However, one difference from the URL parameter interface is that this script will perform any necessary URL escaping to simplify the user interface to the script.
Multiple URL parameters can be specified via this command line interface.
For example, to send a WAP push message, the following command could be used:
cscript sms2.js +44777777777 WAPURL=http://www.nowsms.com “Text=This is a test push”
In this example, because the “Text=” parameter includes spaces, we put quotes around the paramter and value, so that it is recognised as a single parameter value combination.
A simpler example would be sending a message to turn on the voice message waiting indicator (MWI):
cscript sms2.js +44777777777 VoiceMail=On
Or, if you have a pre-constructed binary message, you can directly specify the UDH and Data parameters, such as in the following example:
cscript sms2.js +44777777777 Binary=1 UDH=080D0200040B020007 Data=20 DCS=8
A more complex example would be sending an EMS message. NowSMS defines simple mark-up tags for inserting attributes into an EMS text message. For example, “This is a <b>test</b>!” encodes the text with “test” highlighted as bold on supported EMS compatible phones.
Unfortunately, the “<” and “>” characters are used for input/output redirection from the Windows command line. Therefore to include those characters in a command line string, it is necessary to preface the character with the escape character “^”.
To send this EMS message, the following command line would be used:
cscript sms2.js +44777777777 “EMSText=This is a ^<b^>test^</b^>!”
Related pages:
- Send SMS from Command Line A command line interface can sometimes be useful for quick sending of an SMS message from another application. A message...
- Send MMS from the Command Line Last time, I posted a Windows JScript file that could be used to enable the sending of OMA Client Provisioning...
- Send OMA Client Provisioning (OTA XML Settings) from the Command Line Three years ago on our discussion board we posted a simple Windows JScript that could be used to send an...
- Send MMS Message from Command Line A Windows command line script that enables sending MMS messages from the command line can be downloaded form http://www.nowsms.com/download/sendmms.vbs.txt. Assuming...
- APIs, APIs & more APIs Need more details on how to interface with NowSMS? In this article we provide links to detailed information on interfacing...
- Submitting SMS Messages This section details how applications can submit SMS messages to NowSMS. Applications can submit SMS messages using either HTTP, SMPP...
- Send SMS from a Command Line Interface A command line interface can sometimes be useful for quick sending of an SMS message from another application. A message...
- Submitting MMS Messages Once NowSMS has been successfully configured to send MMS messages via the web interface, it is possible to use various...
- Send SMS from PHP Script Over the coming weeks, I’m planning to collect various PHP, ASP and other script examples to provide some examples of...
- Sending Multimedia Content Push Messages with NowSMS One of the ways that NowSMS can be used for multimedia content delivery is a service that we refer to...
Topic Category: command line interface, WAP Push
For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...

Click here to download a free trial version of NowSMS & MMS Gateway, NowSMS Lite or NowWAP Gateway.
Learn more about NowSMS Lite.