76

What is the best way to programmatically send an SMS text message?

Are there any free Web Service based SMS gateways?

I know that if I happen to know the user's carrier (Sprint, AT&T, etc), I can send an SMS by emailing an address based on phone number + carrier. I would like a good solution that does not require me to know the carrier. Barring that, is there an easy way to lookup carrier given a cell phone number?

I understand that there are some services independent of the major mobile carriers that offer a per-message fee-based service, with API. What I would like to know is how such organizations tap into the SMS networks. Do they have contracts with mobile carriers to resell their services?

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Seibar
  • 68,705
  • 38
  • 88
  • 99
  • You can have a check with **Spring Edge sms gateway** ( https://www.springedge.com ) you can send in bulk using API or Web – BSB Aug 24 '17 at 12:16

11 Answers11

23

Use http://www.twilio.com/

They have a REST interface to send SMS's and even to establish phone calls or receive phone calls.

You even get 30$ credits to try it out.

Def. the cheapest solution you will find.

Christian Joudrey
  • 3,441
  • 25
  • 25
8

Where I work we've been using http://www.clickatell.com for sending out SMS - it looks like its about 6 or 7 cents a message. They just take http POST requests to send out a message. I don't know if you'll be able to find any good free gateways. We used to send out emails, but found they were unreliable.

Angus
  • 505
  • 3
  • 12
6

I've used clickatell in the past and found them very good also.

However, You could build your own to get messages VERY cheap. All you need is: a contract which gives loads of (or unlimited) messages; windows mobile phone; and a bit of socket programming.

Write a web service (pass the number and the message) which makes a call to a program on the mobile which sends the message.

I know of at least FTSE100 company which went this route.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • 6
    Most "unlimited" texting plans have some clause that lets the provider cut you off if you're abusing the system - sending out tens of thousands of automated texts might count :) – sk. Jan 09 '09 at 20:12
  • 1
    Yes, if you're sending thousands, this might not be a workable solution. – Matt Lacey Apr 23 '09 at 09:52
  • @MattLacey I was wondering if this approach is usable even with a "limited" data plan. Find a data plan that charges $0.03 per message and this is $0.02 cheaper per message compared to any API we can find online. – Pacerier Jan 05 '12 at 13:57
  • 1
    Too much text for a simple word : Gammu http://wammu.eu/gammu/ – Telmo Dias Apr 30 '15 at 13:51
5

We got fed up with using 'free' sms gateways, very unreliable.

Now we use an sms gateway device called OutboxSMS from Felltech Ltd. It sits on our network and hooks directly into out mobile phone provider using a wireless link from it's built-in transmitter. We needed to buy a SIM card (we got a PAYG with a huge bundle of messages), which is fitted to the OutboxSMS unit. We configured an email account for it on our mail server (MS Exchange), and configured the SMTP/POP3 account on the box.

We use OPManager, this sends alerts by email, which we direct to outboxsms, it parses the message and sends a text message to our ops guys phones when something goes wrong.

We also have some shell scripts which use sendmail to send an email to outboxsms, which again is converted to text messages.

4

I think this one deserves a new answer. There's a new player in town, it's called Nexmo and features highly competitive prices, even compared to Twilio.

https://www.nexmo.com/

Telmo Dias
  • 3,938
  • 2
  • 36
  • 48
3

I have been doing that with a nokia phone, connected to a linux machine. I have a cron job and a script that would check a database table for new messages and use gnokii to send messages. It works great if the number of sms you are goig to send isn't to big.

Michał Piaskowski
  • 3,800
  • 2
  • 34
  • 46
3

You could also get a GSM transmitter and issue AT commands that send sms's. Don't know why you would want to do it this way, but it's another option. This way you won't depend on someone else service

Eldelshell
  • 6,683
  • 7
  • 44
  • 63
1

I don't know of any free SMS services, you usually buy bulk sms'seses and use an API to send them out.

Whitepages.com has an API that will allow developers to reverse lookup a phone number. It reports the carrier on mobile number, however a lot of the time it's some non-existent-anymore carrier like Powertel or something.

Grant
  • 11,799
  • 13
  • 42
  • 47
0

Supporting Angus, I can vouch for http://www.clickatell.com. It was used at a company I used to work at. It was a very easy solution to setup and use and worked great. You just need to anticipate how many messages you intend to send out and bulk order messages. They're pretty cheap, overall.

Community
  • 1
  • 1
Jeremy Privett
  • 4,455
  • 2
  • 32
  • 35
0

I have used TextMagic. They have reasonable rates and a great API and account management.

Jannie Theunissen
  • 28,256
  • 21
  • 100
  • 127
-1

Sorry, after re-reading your question i realized this is not the answer your looking for. However this is what i did for my command line program. There's a website where if you put in the telephone number it gives you the carrier. So when i entered my number it screen scraped the website, got the carrier and if the carrier is in my list, i retrieved the email of that carrier

Most companies offer a SMS-to-email kinda thing. For example myphonenumber@verizon.com or something (there's a whole list on wikipedia).

I used that to create my self a little command line application in c# that sends out text messages. However, you don't really get a "reply" and the number is a pre-assigned one from the company.

I think if you want to go the free route, this is your best bet.

Here's the wikipedia link: SMS gateway

lc.
  • 113,939
  • 20
  • 158
  • 187
masfenix
  • 7,736
  • 11
  • 45
  • 60