How to send SMS from Command Line using Ozeki NG SMS Gateway
This guide shows you how to send SMS messages from the Windows command line using SendSMS.exe, the built-in command-line tool of Ozeki NG SMS Gateway. This method is ideal for automating message delivery in scripts or integrating SMS functionality into existing systems without using a graphical interface. You will learn how to enable the SMPP server, configure the tool, and send SMS messages directly from the terminal.
Command line SMS client (Quick Steps)
- Start Ozeki NG SMS Gateway
- Enable the built-in SMPP server
- Restart the SMS Gateway service
- Open Command Prompt
- Run the SendSMS.exe command
- Send to multiple recipients
- Check message status
Sending SMS from Command line client using Ozeki NG SMS Gateway
Command line SMS client (Video tutorial)
In this video, you’ll learn how to send SMS messages using the command line tool provided with Ozeki NG SMS Gateway. The tutorial walks through enabling the built-in SMPP server, restarting the gateway, and using SendSMS.exe with the appropriate parameters. You’ll see example commands, syntax options, and how to verify successful delivery through the gateway interface. This method is perfect for developers, system administrators, and technical users who prefer or require terminal-based solutions for messaging.
Step 1 - Enable the built-in SMPP server
Launch Ozeki NG SMS Gateway and go to the Edit menu, then select Server Preferences to begin enabling the necessary connection options (Figure 2).
Step 2 - Enable the built-in SMPP server
In the Client Connectivity tab, check the box to enable the built-in SMPP server. Set the port number to 9500, which the command-line tool will use (Figure 3).
Step 3 - Restart Ozeki NG service
After enabling SMPP, restart the Ozeki NG SMS Gateway service to apply the changes. Use the Service Tool and choose Restart service (Figure 4).
Step 4 - Using the Command line client
Open Command Prompt and navigate to the Ozeki NG installation directory, typically: C:\Program Files\Ozeki\Ozeki NG SMS Gateway. Run SendSMS.exe without arguments to see help info and available parameters (Figure 4).
Help of Ozeki NG SMS Gateway Command line client
Ozeki NG SMS Gateway Command Line Tool; Version: v1.2.0 Syntax: SendSMS.exe -h hostname:port -u username -p password -r recipient -m message [optional parameters] Parameters: -h Hostname and port of Ozeki NG SMS Gateway (Mandator) -u Username -p Password -r Recipient address -m Message text -s Sender address -t Message type -l Log communication, possible values: on/off -c stop condition, possible values: accepted/sent Example: SendSMS.exe -h 127.0.0.1:9500 -u admin -p abc123 -r "+36201234567" -m "Hello world"
If you want to send the same message to multiple recipients you need to separate recipients with semicolons.
Example:
In this example "Hello World" is sent to "+36201234567" and "+36201122334" phone numbers.
SendSMS.exe -h 127.0.0.1:9500 -u admin -p abc123 -r "+36201234567";"+36201122334" -m "Hello World"
You can see a test message sent from the Command line client (Figure 5).
Step 5 - Message accepted by Ozeki NG - SMS Gateway
If the execution of the client is successful, you can see the message is successfully forwarded to Ozeki NG - SMS Gateway (Figure 6).
Step 6 - Sent message in Ozeki NG - SMS Gateway
The command line client can only connect to a standard user in Ozeki NG - SMS Gateway. In this example I have connected to the admin user. The connection and the message sending is visible at the events of the admin user with enabled low level logging (Figure 7).
Step 7 - Sent message
Open the Ozeki NG interface and check the Admin user’s outbox to see the message delivery and connection logs (Figure 8).
Conclusion
To summarize the above mentioned, this solution helped you, how to easily send messages from command line. This is a great small utility to send SMS messages from the command line.