Receive SMS messages in a web application in the US on a hosted server
Asked Answered
H

5

15

I'm trying to build a simple web application that will allow people to send SMS messages FROM their mobile phone TO my application.

I've seen this question asked before:

Receive SMS messages by web application
Receiving a SMS message in a .NET application

... but I have a few unique (I think) circumstances.

  1. I'm expecting a very small number of messages (<1,000/month)
  2. My users are all in the U.S.
  3. I don't need to SEND SMS messages - I just want to allow users to be able to send messages TO the application

I'm aware of major SMS "providers" like Clickatell. However, their services seem like HUGE overkill.

Ideally, I'd like users to be able to send an SMS message to an EMAIL account I have set up. However, based on a (superficial) investigation, it looks like that's not possible. (E.g., I tried it on my iPhone, and the message isn't received).

So, I guess the next best alternative is that my users send SMS messages to a dedicated phone number, and have those messages forwarded to an email account on my server. That would work, I guess. But I'm not sure how to do the forwarding part, or if it's even possible.

Clickatell offers a service like that, but they charge a few hundred bucks to set up a number, a few hundred bucks to RENT the number each month, and a few pennies for each message. And, they only offer non-US phone numbers. (In the US, you apparently need to have a "short-code", that's INCREDIBLY expensive). Seems like there should be a MUCH simpler approach.

I've read that people buy cheap phones and connect them to their server, but I don't have my own server (I'm using a cheap hosted server at MediaTemple).

Heteromorphic answered 1/9, 2010 at 19:59 Comment(2)
Hi Matt. What you ask here is precisely what I've been looking to do. In your answer, you used Google Voice - which I hear is going away. What are you using now? Do you have any code that you could share with the community detailing how you went about doing this?Electrodialysis
JP, about a year ago - I actually switched to Nexmo (nexmo.com/pricing). Sending OUTBOUND SMS messages is still absurdly expensive, but with Nexmo, all INBOUND SMS messages are free. They provide you a phone number (about $1/month), and when users send an SMS message to it, they'll POST a message to your site (e.g., a PHP page you set up to receive those messages). Seems to work great, and I'm really happy with their service and reliability. And you can't be FREE!Heteromorphic
F
6

You might look into http://www.twilio.com/sms/ it's very reasonable pricing and the implementation is really very easy. You should be able to get something setup in a fairly short amount of time.

Fixture answered 1/9, 2010 at 21:3 Comment(4)
And if you have any questions about it, you can email me at [email protected]Indeciduous
Quite expensive 1000 SMS's in $100 come onPeirce
@pankysharma Your math is off by a decimal place. With the current pricing, 1000 text messages would run you $7.50. Even texting from a short code for 1000 texts would be $10.Brashy
@Brashy They might have lowered their prices, Last time I asked them to quote, they replied with the mentioned figure and I was R you kidding me?? :)Peirce
H
15

This is bad form... answering my own question, but I've just stumbled upon a possible simple (and FREE!) option.

You can sign up for Google Voice, using an email address of your own choosing. This gives you a phone number for users to send messages to. Then, through the settings, you can have any text messages sent to that number forwarded to the email address you've chosen. With a little PHP, you can read the phone number of the user who sent the text message, and the body of their message.

So far, this seems to work just fine. Not sure if it complies with GVoice's terms of service, but since my app is small and free, hopefully no one will notice.

I don't know how much volume you can run through this method, or if I'll run into other limitations.

Still interested in hearing about other and better solutions.

Heteromorphic answered 1/9, 2010 at 21:54 Comment(7)
I just perused their terms of use, and I couldn't find anything that you would be violating. Since it's been a while, I'm wondering if you have an update on your quest? I'm in the same boat you were in and am looking for a free way to handle SMS interaction with my app.Cotton
Incidentally, answering your own question's not bad form at all! cf. this page from the help section.Rumanian
@Cotton same here. Did you ever hear or find out if mattstuehler's hack was still working.Danelaw
support.google.com/voice/answer/115116?hl=en&ref_topic=1708439 gives some info for abuse and regulating the number of text messages sent...Danelaw
@les, I had to abandon the project, and I don't have the time to revisit at this point, unfortunately :/Cotton
@Cotton I'm getting it to work with straight PHP and nothing else. iPhone, AT&T, Gmail, PHP is all i needed. Example: mail("yourphone#@txt.att.net", "", "Yo!", "From: Sender Name <[email protected]>\r\n");Danelaw
How did you guys grab the forwarded email with php? Did you setup an email server or something?Interrupt
F
6

You might look into http://www.twilio.com/sms/ it's very reasonable pricing and the implementation is really very easy. You should be able to get something setup in a fairly short amount of time.

Fixture answered 1/9, 2010 at 21:3 Comment(4)
And if you have any questions about it, you can email me at [email protected]Indeciduous
Quite expensive 1000 SMS's in $100 come onPeirce
@pankysharma Your math is off by a decimal place. With the current pricing, 1000 text messages would run you $7.50. Even texting from a short code for 1000 texts would be $10.Brashy
@Brashy They might have lowered their prices, Last time I asked them to quote, they replied with the mentioned figure and I was R you kidding me?? :)Peirce
I
4

I can see how you might have some problems physically connecting that cheap phone to your hosted server. But why would you need a physical connection nowadays? A slightly more expensive phone could receive the SMS, wrap it in a HTTP body and POST it to your webserver. You might even do some rudimentary filtering (e.g. whitelist/blacklist). All data traffic would be over the air, which - at the volumes mentioned - would still be affordable.

Illuminism answered 2/9, 2010 at 13:22 Comment(2)
I'm new to this area, but this sounds like a very good approach. Would you happen to have a link or know of something that goes into more detail? I am a Visual Studio developer, so I would like to do this for the Windows Phone. iOS or Android would require an SDK learning curve.Electrodialysis
Sorry, you probably won't find a specific tutorias. This is just a matter of putting building blocks together; shouldn't be a big deal for a developer. Windows Phone isn't an option, though: Microsoft still doesn't understand mobile phonesIlluminism
H
3

Here's another option:

Get your hands on a cheap Android device with GSM connectivity and install one of the many SMS Gateway apps in the Google Market.

For example, SMS Gateway says to support these features:

This application turns your android phone into powerful SMS gateway.

Features:

  1. Periodically checks for e-mails via POP3 and send them via SMS.
  2. Send SMS by HTTP GET request on its internal webserver.
  3. Forward received SMS to desired e-mail via SMTP.
  4. Forward received SMS by calling remote webserver via HTTP GET.

So you can forward incoming SMS to an email address or a web application (or web service or web API) and also you can SEND SMS via a HTTP GET request to its very own internal webserver.

Pretty neat, I'd say. And I'm sure there are others with similar or better features, still.

I am not affiliated to SMS Gateway (or any other sms gateway app on the Google Market).

EDIT: Forgot to mention... It's free!

Henhouse answered 28/1, 2016 at 12:12 Comment(2)
the only problem it got, it doesn't support sending UTF-8 chars, so only English is going to workSirotek
@Sirotek You can always escape the non ascii characters before sending.Henhouse
P
1

Take a look at OptIt. They work well for small-time SMS operations. They do dedicated shortcodes (expensive) as well shared shortcodes (for $20/month/keyword and $0.02/message). Their website is quite useful and has a lot of functionality (subscriptions, autoresponses, subkeywords). In addition, they offer an API so that you can have custom behavior.

Palmira answered 1/9, 2010 at 20:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.