So I finally got around to whipping up a sample application that demonstrates sending an SMS (often referred to as a “text message”) using the GMail SMTP server features. It uses the code described in my previous blog entry here. In order to use this, you need a GMail account, a cell phone to send the messages to, and the proper carrier SMS gateway. (See the previous mentioned link), or check it out on wikipedia here.
How to use it: Put in your phone number with the appropriate country code. For example, my mobile phone number is 1-403-795-XXXX (where the XXXX are the last 4 digits of my phone number). So, in the “phone number” field I put “1403795XXXX”, without any spaces or dashes. I select the carrier from the drop-down list box. If the carrier isn’t listed (which it probably isn’t), read the next paragraph. Put in your GMail email account and password, and the message you want to send. If the message length is over 160 characters, it won’t let you send it (or at least it shouldn’t…).
To set it up for a different carrier, see the wikipedia page to find if your particular carrier indeed has an Email to SMS gateway. If it does, look in the “carriers.xml” file bundled with the .exe – it contains a list of carriers, and should be pretty easy to figure out how to add another carrier.
Also note that it takes a while for the message to get through – sometimes a minute or two.
You can download the sample application here.
ONE MORE NOTE: It seems that just recently, something has stopped working. I’m not sure what, whether it’s my particular mobile carrier, the GMail SMTP server, or what, but something isn’t functioning properly. Feel free to give the app a try and see if you have some better luck.
EDIT: Please note – I will not be held responsible or liable for any damage or un-cool circumstances that may arise from the use or mis-use of this application. It’s meant as a proof of concept more than anything else. Don’t be stupid with it!