Compsmag is supported by its audience. When you buy through links on our website, we may earn an affiliate commission fee. Learn more

Send an SMS Text Message from Command Line

Check tutorial of Send an SMS Text Message from the Command Line

So after a lot of requests from our users here is a guide about Send an SMS Text Message from the Command Line.

When you think of sending text messages you probably think of the iPhone or an Android, and the command line doesn’t come to your mind, but thanks to the ever-useful curl command, you can send a text message to any phone number directly from the terminal.

Yes, curl, the same command line tool for transferring data to and from URLs, downloading files, getting HTTP header details and much more, can send text messages. This is done via a POST request sent to the TextBelt service, a free outgoing SMS API. Of course there are limits, but they are quite generous with 75 text messages per day (per IP), and you cannot send more than 3 text messages in three minutes to avoid abuse. In addition, keep in mind that incoming text messages will be billed at the regular SMS / SMS rate from your cellular provider – it doesn’t use the iMessage service – so don’t overuse this if you don’t have unlimited traditional SMS. plan.

Send a text message from the command line with curl

The basic syntax to use is as follows, replace the ########## with your own 10 digits phone number (10 digits = area code + phone number), then replace the message = text with your own message to send:

curl http://textbelt.com/text -d number = ########## -d “message = text goes here”

For example, if you want to send a text message saying “hello from OSXDaily.com” to it phone number 555-155-1555 (not a real number), you would use the following command string:

curl http://textbelt.com/text -d number = 5551551555 -d “message = hello from OSXDaily.com”

Yes, you could post other people phone number in there too, but you probably shouldn’t do that without their permission.

If the text is sent successfully, the command line will return a message stating ‘{“success”: true}’, if it fails for any reason it will look something like the following, which usually indicates a error in your command syntax: ‘{“success”: false, “message”: “Number and message parameters are required.”} curl: (6) Cannot resolve host:’ Just check the command string and try again.

The text message should arrive on your iPhone or Android very quickly, although the usefulness of the service probably depends on a queue and how much activity TextBelt is receiving from elsewhere. It will look something like this:

SMS texts on an iPhone as sent from the TextBelt command line service

(If you’re wondering, responding to the text messages is going nowhere and doesn’t do anything, it’s not a two-way service)

This works to send texts from Mac OS X, Linux and presumably any other operating system or service that has curl access. The receiving end should work with each mobile phone that accepts text messages, be it an iPhone or an old brick Nokia.

Add a quick ‘Send Text’ command to Bash

If you are comfortable sending yourself texts from the terminal and plan to use this often, you can create a simple bash script to shorten the command string by adding the following to your .bash_profile. Make sure to replace the number with your 10 digit phone number:

sendtext () {curl http://textbelt.com/text -d number = 5551113333 -d “message = $ 1”; echo message sent; }

With that in your bash_profile, you can simply type “sendtext your message comes here” to send a text to yourself. This also provides some fun and usability with dual ampersands &&, like sending yourself SMS notifications when a software package has finished installing or when an external file has finished downloading. Those with command line experience can probably think of a million here and one more useful uses for this.

According to TextBelt, the service certainly works within the US with the following cellular networks: Alltel, Ameritech, AT&T Wireless, Boost, CellularOne, Cingular, Sprint PCS, Telus Mobility, T-Mobile, Metro PCS, Nextel, O2, Orange, Qwest, Rogers Wireless, US Cellular, Verizon, Virgin Mobile. This may be limited to the US, but we are unable to test networks outside of the region, please let us know if you try elsewhere.

Send an SMS Text Message from the Command Line Guide is free?

Starting from: Free
This guide is a free model
Free Trial: May be included, please check on the official site, we mentioned above.
The Send an SMS Text Message from the Command Line tutorial price is Free or Freemium. This means you can truly enjoy the Send an SMS Text Message from the Command Line guide.

The Send an SMS Text Message from the Command Line guide gives you an easy-to-use and efficient management and Send an SMS Text Message from the Command Line allows you to focus on the most important things. It’s friendly guide to use maybe you will love it and Send an SMS Text Message from the Command Line tutorial can be used on Linux, Windows or android devices.

Send an SMS Text Message from the Command Line: benefits

  • The Send an SMS Text Message from the Command Line tutorial is free .
  • Helps many users follow up with interest in a timely manner.
  • The price of the Send an SMS Text Message from the Command Line guide is free.

Send an SMS Text Message from the Command Line: FAQ

Tutorial Summary: Send an SMS Text Message from the Command Line

In this guide, we told you about Send an SMS Text Message from the Command Line; please read all steps so that you understand Send an SMS Text Message from the Command Line in case if you need any assistance from us, then contact us.

How this tutorial helping you?

So in this guide, we discuss the Send an SMS Text Message from the Command Line, which undoubtedly helps you.

What is actual time in which this method complete?

The time to complete the Send an SMS Text Message from the Command Line tutorial is 10+ minutes.

What are the supported Device?

Apple

What are the supported Operating system?

mac OS


Send an SMS Text Message from the Command Line Tutorial: final note

For our visitors: If you have any queries regards the Send an SMS Text Message from the Command Line, then please ask us through the comment section below or directly contact us.
Education: This guide or tutorial is just for educational purposes.
Misinformation: If you want to correct any misinformation about the guide “Send an SMS Text Message from the Command Line”, then kindly contact us.
Want to add an alternate method: If anyone wants to add the more methods to the guide Send an SMS Text Message from the Command Line, then kindly contact us.
Our Contact: Kindly use our contact page regards any help. You may also use our social and accounts by following the Whatsapp, Facebook, and Twitter for your questions. We always love to help you. We answer your questions within 24-48 hours (Weekend off).
Channel: If you want the latest software updates and discussion about any software in your pocket, then here is our Telegram channel.

Compsmag