content developer build share monetize content developer logo content developer masthead bottom

Open Source SMS Text Messaging Application

I recently built a basic text message delivery application designed for a local broadcast television station to send breaking weather and traffic alerts to the mobile devices of subscribers to the free service. I learned some things along the way and wanted to share a quick overview of how the application was put together.

First, this approach is designed for those wanting to deliver SMS text messages in the United States. In the US, the system is open to senders to send text messages to mobile devices with no charge to the sender. Those on the receiving end of the text message are billed according to the particular service plan they have with carrier. The main point to remember here is that those who receive text messages are usually billed in some form or fashion so be sure they really want to receive what you are sending.

I believe SMS billing is handled differently is many overseas markets, where both the sender and receiver are billed, so be sure and investigate for yourself if you are outside of the US.

The US mobile carriers make it possible to do this because each mobile device has a unique email address that when delivered through the providers website will be sent as an SMS message to the mobile device. Note: this email address is different than the standard email address many mobile devices are also issued. For all of the carriers the addresses are constructed pretty much the same way.

10 digit mobile number at special sms address .com

For instance, ’s special SMS messaging address is

messaging.sprintpcs.com

So, a Sprint mobile user with the phone number 123 456 7890 could be sent a SMS text message at the address

1234567890 @ messaging.sprintpcs.com

A somewhat comprehensive list of these SMS addresses for US mobile carriers can be found here among other places.

OK, so now that we know how to communicate with the mobile device the next step is to build a couple of small applications with and that allow your customer or audience to sign up and receive your mobile alerts. Please remember, MOBILE ALERTS ARE OPT IN ONLY. Spam is evil whether it is delivered to your inbox or your phone.

First — the signup form:

To get started, on a virtual server I used to create a new MySQL database called newsalerts. In this database I created a table called subscriptions. In this table I created 3 fields: mobilenumber, provider, smsaddress.

From there I used PHP to build the database front end sign up form. Here’s a screenshot:

mobile-alerts-signup-exampl.jpg

This is a relatively straightforward PHP database signup application with a little extra bit in there that combines the three sections of the phone number, adds an @ sign and the carrier address info to create the complete SMS address for that device.

The second part of the process is an application that allows the meteorologist or traffic reporter to enter a message title and the text message to send. When they press send, the application will then loop through the database of subscribers and deliver that message they created via SMS to each subscriber.

Here is a screenshot of this part of the application:

mobile send example.jpg

The message can be up to 160 total characters in length (assuming 7 bit characters). The user can also simply send a URL link if they want to send the subscriber to a more graphically rich mobile site that might include a radar map or a picture of an auto accident.

IMPORTANT — anyone with access to this part of the application can send alerts to all of your customers so if you are building something like this you will definitely want to use or some other method to password protect this part of your application.

Both parts of this application use the open source application to handle the mail process and rely on PHPMailer’s class.phpmailer.php.

Now for a couple possible downsides to this approach:

First, most of the mobile carriers warn that SMS text message delivery using this process can be delayed, but with all my tests to date, delivery of the text message has taken less than two minutes, most all under a minute and many times delivery to the device is just a matter of seconds.

Second, as stated earlier, you are restricted to sending only 160 characters of text via this method. No messaging via these protocols. This does limit you somewhat but doesn’t really strike me as an obstacle since if your content involves more than just text, then you can simply send your user a link to your rich mobile content that they can then download. This seems like a reasonable workaround in most cases.

To recap, by taking advantage of open source tools and techniques like these just about any type of content developer or small business can take advantage of mobile devices to help build relationships with your audience or customers.

And here’s a thought, if your business model involves your audience or customer paying to receive your content, then you can team this approach up with the and you are ready to go with an entry level SMS content distribution strategy.

Update: If you’re working on delivering audio or video to mobile devices, be sure and read about the mobile carriers and devices we tested in the post

gray line

Filed under distribution by david cummings on Thursday 1 June 2006 at 9:10 am

  |   Sphere: Related Content

22 Comments »

  1. Comment by Matt Beeman — June 13, 2006 @ 12:20 pm

    We have been experiencing problems specifically with Sprint phones receiving our text messages. Have you found any particular problem with sprint phones?

  2. Comment by David Cummings — June 13, 2006 @ 5:55 pm

    I’ve had good luck with Sprint as far as receiving messages sent with this app and knowing what to do when you only send a link.

    Not sure it is related to the issues you are running into with Sprint, but there is a conversation going on in the Sprint Developers Forum (developer.sprint.com) about some changes Sprint may have made in their WAP Gateway and its impact on some WAP sites.

    One situation that has surfaced is the way some carriers and devices appear to handle any links that are sent via SMS. In some of the carriers on some of the devices that have been tested so far, URL’s aren’t hot when the user opens the SMS message and need to be cut and pasted into the phones wap browser. It appears to be the minority of cases, but that is something that has popped up.

  3. Comment by Travis J. James — September 14, 2006 @ 1:14 pm

    This is a great article. I implemented something like this myself, but there were a few limitations to get around, and I would like your input on how you handled these:

    1. This solution requires that you know the carrier as well as the phone number, so you can locate the right SMTP server. Because of this, the user wishing to receive the message must subscribe first with this information.

    2. Because users can change networks now without changing their cell phone numbers, this makes it difficult to keep this information in sync unless the user helps.

    3. If you wish to implement something that allows the user to send text messages to any number (not just ones that are registered with your application), they must know the carrier.

    Have you found any solutions to these problems that don’t involve purchasing expensive libraries that basically hard code the SMS gateway addresses (and thus can get out of sync and require lots of maintenance after you pay a lot of money)?

  4. Comment by David Cummings — September 16, 2006 @ 1:51 pm

    Hi Travis:

    Thanks for the questions. You’re right on target. When the subscriber signs up they have to provide their mobile number and the mobile carrier they are with and if they move their number to a new carrier then they need to update their subscription.

    Have not found a way around this, but for apps in the subscription/registration model (paid or free) and within a certain scale the tradeoffs seem manageable. In the scenario that you give in example 3 with an open setup with no registration, no knowledge of the carrier and a potentially very large scale this approach no doubt becomes difficult if not near impossible to implement.

    To use this open method for delivery, one way or another we need a database of phone numbers with corresponding mobile carriers. Either the user provides that info or we have to get it from somewhere else. If there is a reliable, manageable and affordable method of deducing the carrier (and therefore the delivery address) from the phone number alone that would be a huge plus. Since the FCC passed local number portability
    that seems like a pretty big challenge though. What was once a landline could now be a Sprint phone that will tomorrow be a Cingular phone. Or vice versa.

    If you find workarounds or new approaches that improve these areas I would very much like to learn about them so please check back and share what you find.

    Good luck with your app Travis.

    DC

  5. Comment by Ian Warshak — December 8, 2006 @ 8:50 am

    Hi David,

    I found your blog posting about your SMS messaging solution in the strangest way. It started out I was looking up information about ATT’s U-verse here in San Antonio. I found satechblog.com, and then somehow I found contentdeveloper.com.

    Anyway your posting about delivering SMS messages immediately caught my eye. The reason is, I have done the exact same thing. In fact, my company’s business is based off of sending SMS alert messages (emergency school closing information). I live here in San Antonio,
    but emergency school closings happen a lot up north, so getting this information to parents in a timely manner is important. It’s not that
    critical in south Texas.

    Anyway, for our first attempt at SMS messaging I did exactly what you described. That is, using the carrier’s email -> SMS gateway. The
    problem was that the carrier’s gateways can be very sensitive, and start blocking your messages if they suspect it may be spam (since the user bears the cost). We were sending thousands of alert messages, and carriers (verizon in particular) started to block us. We were able to get temporarily whitelisted, but in the end we chose to go with a true SMS aggregator in order to more reliably send these messages.

    I learned WAY more about SMS messaging than I cared to, but it is working for us now :-)
    Anyway, I just wanted to share that. I thought it was interesting that there was more than 1 person in San Antonio that developed such
    similar SMS alert mechanisms :-)
    I will add your blog to my newsreader. Glad I found it!

    Ian

    (note: Ian sent these comments as an email but I wanted to share them here as I thought it might be helpful to alert you to some potential roadblocks with this approach if the open source sms service you are building is going to scale beyond a small to medium sized audience. Thanks Ian for letting me post your email and share your experience. DC)

  6. Comment by John Garrett — December 8, 2006 @ 4:20 pm

    Ian,
    My business will be sending out SMS alerts and we’re trying to determine how far we can go using the carrier’s email. How much message volume did you have when they started blocking you? Who did you speak with at the carriers to get whitelisted, and how much message volume did they allow at that point before you had to get provisioned with a short code?

    Thanks!
    John

  7. Comment by ian — December 10, 2006 @ 4:33 pm

    John - There is no exact number, but we were sending out thousands of alert messages. Verizon seemed to be the most sensitive.

    Ian

  8. Comment by dave — December 29, 2006 @ 5:08 am

    hi,

    your project seems very interesting. i saw this while researching for info on sms based application developing. i’ve recently made an app, on c# though, same as yours, can send and receive sms. i also used a gsm modem as the hardware part of the app.

    maybe we can share insights on developing sms based applications

    keep up the good work!

    dave

  9. Comment by James — June 27, 2007 @ 5:01 am

    hey
    actually i had to make an application similar to this one sending messages at mobile networks, ok, i just read this article and that php and mysql thing is so simple will do that in 15 minutes, but i was just wondering what’s the actual code you wrote in php for sending those sms alerts/messages to all the email addresses in your database. kindly let me know as soon as possible

  10. Comment by Chris — August 27, 2007 @ 9:46 pm

    Thanks a lot for the insight into problem I have been trying to figure out.

    How would one unsubscribe, directly from their phone?

    For instance most SMS stuff uses a 4-5 digit number. “text unsub to 23232″

    Without this capability in your method, how do you deal with people who want to unsubscribe?

  11. Comment by John Bolder — September 8, 2007 @ 2:22 pm

    Hi Guys

    You may want to visit http://www.mysmsaddress.com or virtualtextmessenger.com for your group SMS requirements its a real SMS Gateway

  12. Comment by dc — September 12, 2007 @ 7:15 am

    >>How would one unsubscribe, directly from their phone?…Without this capability in your method, how do you deal with people who want to unsubscribe?<<

    No doubt Chris. This is one of the challenges of this approach.

    Current options for handling is letting the user unsubscribe via email sent from their phone or from browser at a URL. For users’ with newer phones, this works pretty well. Older phone users can accomplish from desktop.

    Certainly not as elegant as texting “unsub” to a short code, but for a content developer with a small to medium size user base, a work around that perhaps some can live with.

  13. Comment by Scott — September 26, 2007 @ 9:16 am

    Hi David,

    I really enjoyed reading your post on the SMS handling system that you developed. I’m not a developer, but I’d like to create an application that allows users who sign-up via the web to receive group text messages from computers or mobile phones (also communicate via email) and have a reply-all feature on their phone. I’d like to partner with a developer / programmer….what programming languages are necessary?

    Also, do you think that I should go the route of an SMS aggregator or develop our own system? If I develop my own system, how much will it cost to receive text messages? The aggregators charge one to four cents to send / receive messages.

    I appreciate any insight that you can provide.

    Best regards,

    Scott

    (note: Scott sent this via email earlier this week, and with his permission I’ve posted his questions here. Many content developers are evaluating the same decisions and it would be interesting to hear about the different directions people are going with, and why. Thanks Scott. DC)

  14. Comment by Emmett Lunceford — January 10, 2008 @ 9:59 pm

    David,

    I’d like to host an app. which would have the ability to allow the client to schedule 1) phone reminders 2) email reminders 3) SMS text message reminders.

    Do such an application already exist in the marketplace? Thank you in advance for your reply.

    Emmett

  15. Comment by dc — January 19, 2008 @ 3:54 pm

    Hi Emmett:

    I don’t know of an open source turnkey app available that you can download, install and be up running right away doing exactly what you are after…yet

    One approach some people have taken — many of the calendar apps have this functionality or something close to it built in. Many of them also have their API’s available to build your own add ons or hook into.

    Backpack comes to mind.

    http://backpackit.com/

    Good luck, and let us know what you find.

    DC

  16. Comment by Mike Foland — March 18, 2008 @ 4:25 pm

    Hello,

    I am trying to build a school closings system with NWS advisories map, php scroll, etc… plus a school closings area so that schools can post closings, and then they show up in a special format on the public side. I already have some of the interface done, just now trying to do the school closing part. I also want my closings to auto expire.

    How do I go about this using MySQL and PHP?

    Thanks,

    Mike

  17. Comment by dc — March 20, 2008 @ 10:30 am

    Hi Mike:

    You may want to take a look at what Ian is doing at School’s Out and Campus Wire.

    http://www.schoolsout.com/

    http://www.thecampuswire.com/

    Good luck with your project.

    DC

  18. Comment by Craig Sour — April 25, 2008 @ 9:12 am

    Ian,

    Great to see good feedback on a technology such as SMS on your site. SMS is quickly becoming a common tool of use in our daily lives. This is proven by the recent unlimited everything offers from all the carriers.

    My question is this:

    Is there a way to house your own SMS gateway solution and effectively reach your targeted audience. We are looking at providing a service to communicate with thousands of people daily but the volume varies day-to-day.

    Do you do anything with MMS? I would really like to explore this but am told that we should build a custom application for phones to do this…what do you think?

    Craig

  19. Comment by ian — April 29, 2008 @ 10:20 pm

    Craig, I haven’t done anything with MMS.

    I am currently using clickatell.com for my SMS delivery.

    Housing your own SMS gateway requires direct connections and agreements with the major carriers. This is probably cost prohibitive to most companies.

  20. Comment by Brian Caine — April 30, 2008 @ 5:00 pm

    Great idea. I was looking for SMS info and finally stumbled across your post. I am a school teacher who is looking for ways to successfully implement cell phones in class, so our district will get over its arcane policies, and was wondering if someone would care to help a relatively novice programmer set up a system. I am strong with basic web programming, but novice with SQL and PHP, my remotely hosted site has plenty of options for the database, but any help/walkthrough would be much appreciated.

  21. Comment by Anu — May 28, 2008 @ 11:55 am

    Hello Ian,

    I am working on an SMS emergency alert application for my school and we are looking into using Clickatell. How happy have you been with their service? Any complaints? Would you recommend them? Do School’s Out and CampusWire both use Clickatell? I am trying to grasp the whole setup and I am wondering why should one use these when they can directly sign up with Clickatell? Could you clarify that for me?

    Thanks,
    Anu

    BTW, great post DC.

  22. Comment by Matt — June 13, 2008 @ 11:24 pm

    Hi, David;

    Great and helpful site. I was hoping that you could provide a little more help in the form pointing me in the right directions.

    I have sms content that I believe people will be willing to pay for, per sms. Ideally, they would send a request via sms, and they would then receive my content via sms. They would pay for it, and I would get a cut, per sms.

    Do you know of any services that can help me with this (I imagine they will take a cut, or include advertising)?

    Not ideal, but if that doesn’t work, is there a service that will set up my content to be delivered once a person subscribes, and pays a monthly fee?

    I am new to the sms business and technology side of things, but have killer content to get into the hands of users, and need help with how.

    Thanks so much for any and all suggestions,

    Best,

    Matt

RSS feed for comments on this post.

Leave a comment

Next article: Click.TV
Previous article: Disappointed Spurs fans might enjoy this viral video.

spacer

More Fresh Content -- The Latest Activity on the Content Developer Network.

spacer

Content Developer Bookmarks

Netflix Film Submissions
This is an explanation of how indie films without existing distributor relationships can submit completed film projects to Netflix for consideration for distribution via Netflix DVD and online streaming Watch It Now service.

Cinetic
Cinetic Media provides entertainment and media strategic advisory services focusing on film finance, film sales, analytical data collection, digital rights management and talent management.

Balihoo
Balihoo offers a suite of advertising productivity tools designed to help facilitate the exchange of data and dollars between media buyers and media owners, publishers and sellers.

Spot.us
Spot.us uses crowdfunding to commission freelance journalists to investigate and report on stories. Journalists can pitch stories and those that are funded are published under a creative commons license for traditional and new media outlets to use.

Projjex
Projjex is a collaborative task management service offering a web based approach to managing projects for small and medium sized teams. Free and paid versions.

Wuala
Wuala offers free social online storage which allows users to securely store, backup, and access files from anywhere and to share files with friends. Users can also trade local storage for online storage.

Jivox
Jivox provides a suite of free online video production tools and media assets for small businesses to create video advertisements for web delivery through the Jivox network of web publishers. Advertisers can manage and target their campaigns through integrated set of media buying tools.

more bookmarks...

Content Developer Comments

Comment on Open Source SMS Text Messaging Application by Matt
Hi, David; Great and helpful site. I was hoping that you could provide a little more help in the form pointing me in the right directions. I have sms content that I believe people will be willing to pay for, per sms. Ideally, they would send a request via sms, and they would then receive my content via sms. They would pay for it, and I would get a cut, per sms. Do you know of any services that can help me with this (I imagine they will take a cut, or include advertising)? Not ideal, but if that doesn't work, is there a service that will set up my content to be delivered once a person subscribes, and pays a monthly fee? I am new to the sms business and technology side of things, but have killer content to get into the hands of users, and need help with how. Thanks so much for any and all suggestions, Best, Matt

Comment on Open Source SMS Text Messaging Application by Anu
Hello Ian, I am working on an SMS emergency alert application for my school and we are looking into using Clickatell. How happy have you been with their service? Any complaints? Would you recommend them? Do School's Out and CampusWire both use Clickatell? I am trying to grasp the whole setup and I am wondering why should one use these when they can directly sign up with Clickatell? Could you clarify that for me? Thanks, Anu BTW, great post DC.

Comment on How To Get Your Own SMS Common Short Code by George
Paying for your own shortcode is not the only way to reap the benefits of this fabulous way to communicate with your customers on the mobile networks. Several companies that have shortcodes will lease you the use of their shortcode. By using unique keywords to differentiate your message from potentially thousands of others using the same shortcode, you can achieve the same results at a fraction of the cost. i.e. texting "AUDI" to a shortcode might get you an instant text message, coupon or contest entry from your local Audi dealer, while texting JBARG to the same shortcode might get you a text message good for a free appetizer at Joes Bar and Grill. No jumping through hoops and no steep learning curves. Cheers! George note: comment edited by admin

comment feed...

spacer

Best of the Web -- Recommended Blogs & News for Content Developers.

spacer

The Business of Content

MSNBC Host Rips AP Reporter's Analysis of Obama Speech
Editor & Publisher 08/30/2008 04:11 AM

Elevator Pitch Friday: Challenge Your Fellow Man
TechCrunch 08/29/2008 09:11 PM

Microsoft Privacy Chief Announces Windows Cognitive Impairment [Digital Daily]
All things D 08/29/2008 08:05 PM

10 Things to Know and Hate About Metered Broadband
GigaOm 08/29/2008 05:38 PM

Posh Facebook Conference Canceled
Silicon Alley Insider 08/29/2008 05:00 PM

Report: Podcast Consumption Up; Still Not a Daily Fixture
Digital Media Wire 08/29/2008 02:48 PM

Sept 1st Holiday: Updating For Breaking News; Newsletter Resumes Tuesday
Paid Content 08/29/2008 01:38 AM

Search, Marketing & Social Media

Which Is Worth More? Product Search or Information Search….
Mashable 08/29/2008 10:44 PM

Groundswell analysts from Jupiter/Forrester/US/EU: Yes, it blends!
Groundswell 08/29/2008 01:56 PM

Prediction Markets Go Nuts Over Rep VP Pick
MIT Ad Lab 08/29/2008 12:43 PM

Trends That Will Help Define the Future of PR and Marketing
MicroPersuassion 08/28/2008 09:25 PM

Talking Shop with Zane Safrit
Brand Autopsy 08/28/2008 01:57 PM

Mashing the Forrester and Jupiter Social Technologies Research teams
Web Strategy by Jeremiah 08/28/2008 01:48 AM

PRWeek Final Four: Communication Overtones Advances with Four Excellent Blogs
Communications Overtones 08/27/2008 01:59 PM

Indie Film, Web & Mobile

FCC Fridays
Engadget Mobile 08/29/2008 11:10 PM

Who Beat Palin in 1984? See Here...
Matt Dentler 08/29/2008 03:12 PM

WORKSHOP: Screenplay Coaching
SA Film Commission 08/29/2008 01:33 PM

Just Confirmed Panelist, Twilight and Showtime series Dexter writer, Melissa Rosenberg
Austin Film Festival 08/28/2008 02:26 PM

Scrippets are go
John August 08/28/2008 12:26 PM

Ya'Ke Brings Home TFPF Grant
Film San Antonio 08/27/2008 09:05 AM

Resistance Is Fertile!
Blake Snyder 08/26/2008 10:37 AM

spacer
Content Developer is powered by Wordpress. ContentDeveloper.com and build. share. monetize. are trademarks of Cummings Hatton Corporation.