I recently built a basic SMS 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, Sprint‘s special SMS messaging address is
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 PHP and MySQL 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 FreeBSD Apache virtual server I used PHPMyAdmin 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:
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:
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 .htaccess or some other method to password protect this part of your application.
Both parts of this application use the PHPMailer 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 MMS 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 Paypal Monthly Subscription Option 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 Delivering 3GP and MP3 Content with SMS Text Messaging.