SMS via Email

This entry is part 17 of 17 in the series Sending out an SMS

Of course sending an SMS via an attached phone or GSM modem using AT commands in PDU mode is fun :-) . Sometimes you just want to send a plain text message from your application and you don’t want to bother with phones, SIM cards, data plans, PDU mode and so on.

In these cases the easiest solution would be to use an SMTP to SMS gateway. SMTP is the protocol used to send email (Simple Mail Transfer Protocol). What such a gateway does:

  • is receive an email
  • look at the intended recipient
  • figure out a phone-number from/for that recipient
  • send the text of the email as an SMS to the recipient’s phone

You could send an SMS message this way using any SMTP library (they come with .NET, JDK and many open source libraries are available to do this from C or C++).

There is a really simple way to test this: just send an email from your email client.

Of course there are some limitations:

Read More…

Setting Voicemail Waiting Indication via SMS

This entry is part 16 of 17 in the series Sending out an SMS

As shown in an earlier post, the Data Coding Scheme (DCS) octet in the SMS PDU can be used to turn a regular text message into a flash message.

Another feature of SMS that is enabled through use of the DCS is the Message Waiting Indication:

  • When someone leaves you a voicemail, the voicemail system communicates with the SMSC to send your phone a special SMS message that turns on the little icon on your phone that indicates that you have a new voicemail.
  • When you listen to your voicemail, the voicemail system also communicates with the SMSC to send your phone a SMS message that turns the little icon off again.

Using the DCS you can turn the voicemail icon on or off yourself.

This is an example PDU to set a voicemail indication:


Here is what the individual octets represent:

Read More…


This entry is part 15 of 17 in the series Sending out an SMS

I have added a page with references to the official 3GPP, Open Mobile Alliance (formerly WAP Forum) and other specifications that are relevant for the topics in this blog so far.

See here.

I’ll keep that page up-to-date.

How to pack GSM-7 characters into septets

This entry is part 14 of 17 in the series Sending out an SMS

Once we have our text in the GSM-7 character set, we’re ready to write the septets. As is show before, the mapping is kind of awkward, see 3GPP TS 23.038.

Here is the algorithm I use to achieve this: Read More…

GSM-7 Encoding with the GNU iconv library

This entry is part 13 of 17 in the series Sending out an SMS

To produce the GSM-7 encoded text that is needed for SMS text messages sent with a GSM modem in PDU mode we need 2 steps.

First we need to convert our text to the GSM-7 character set.

The GSM-7 character set is described in 3GPP TS 23.038.

I’ve always been a fan of the GNU iconv library (libiconv). This library lets you convert practically any character set to any other character set. It does this by internally:

  • converting the source character set to Unicode and
  • converting from Unicode to the destination character set

Unfortunately libiconv does not have support for the GSM-7 character set, so I have added it myself. Read More…

Text formatting with EMS

This entry is part 12 of 17 in the series Sending out an SMS

We have seen how you can use the User Data Header (UDH) in an SMS message to combine several SMS messages into one bigger one. Here is an other application of the UDH:

Text formatting in SMS

Remember that the UDH consists of Information Elements (IE) that each have the following structure

Length Value Description
1 octet IEI Information Element Identifier. This determines what this IE is about.
1 octet IE length The length of the data belonging to this IE in octets.
n octets IE data Meaning of the content varies per IEI.


The text formatting is controlled by just one IE. Here is a description:

Read More…

SMS based applications

This entry is part 11 of 17 in the series Sending out an SMS

Just a quick update.

The next article I’ll publish will be about receiving SMS messages on your computer.

There are interesting applications you can build with SMS, some require you to be able to receive SMS messages as well as send them:

  • Phone number verification. After the user has supplied you with their cell-phone number, you can send a code in a SMS message to a cell phone and have the user confirm that code on a web page.
  • Remote control. You can write an application that waits for incoming SMS ‘commands’. Your application sends the commands and returns the results of the commands via SMS.
  • SMS alerts. You can write an application that monitors your computer/software/network and/or website and sends out an SMS alert whenevr their is something out of the ordinary.
  • SMS marketing. After you’ve captured you’re audience’s cell phone numbers, you can occasionally send reminders, offers, coupons, etc you get them back to you’re website.
  • SMS voting. Made popular by shows like American Idols, voting by SMS is one of the more successful applications of SMS.

Read More…

Sending a bookmark over SMS

Another use for SMS is configuring phones over the air (OTA). There are elaborate standard specifications written by the WAP Forum (now Open Mobile Alliance) and somewhat proprietary standards developed by Nokia and Ericsson.

Today I’ll show in detail how to send a bookmark according the Nokia / Ericsson specification. The specification is somewhat older, it dates from September 2001, but it seems almost all Nokia and many Ericsson devices still support this.

The bookmark is described in an XML file like the following:

< ?xml version="1.0"?>
<characteristic -LIST>
   </characteristic><characteristic TYPE="BOOKMARK">
       <parm NAME="NAME" VALUE="Mobile Tidings"/>
       <parm NAME="URL" VALUE=""/>

As before we send this XML document using an unconfirmed push. Here are the layers we need to implement:

  • the XML document needs to be WBXML encoded and
  • the WBXML need to be wrapped in a WSP (Wireless Session Protocol) Push PDU
  • this needs to be wrapped in a WDP (Wireless Datagram Protocol) packet
  • this needs to be sent inside an SMS

As always we start with the AT command that is used to send the bookmark and analyze in detail how this AT command was constructed:

Read More…

Another WAP Push over SMS encoding

This entry is part 10 of 17 in the series Sending out an SMS

I still needed to show how you can send an Service Indication (SI) document like:

< ?xml version="1.0"?>
   <indication href=""
     si-expires="2009-03-04T16:25:00Z">Check out Mobile Tidings!</indication>

This document, a Service Indication, tells the WAP client to store the following:

  • A link to
  • With text “Check out Mobile Tidings!
  • This typically shows up in a “WAP Push Inbox” or sometimes in the “SMS Inbox
  • The link will show when it was created
  • It should automatically be removed after the expiry time mentioned

Well here is the AT command to send this particular SI document:

Read More…

EMS and WAP Push support

This entry is part 9 of 17 in the series Sending out an SMS

As I have been writing about EMS and WAP Push, I am sure your ask yourself: “Does my phone support this?”. Again we dig into the WURFL database and we see that WAP Push is widely supported, but EMS a little less so.

This is understandable, because WAP Push is a protocol used in MMS (or picture messaging). Since most phones nowadays are camera phones and support picture messaging, they’re very likely to support WAP Push.

Here is a list of devices that support EMS and/or WAP Push, according to WURFL:

Read More…