Blog ARCHIVE
»
Transformers 2 and Linkin Park's soundtrack - New Divide
»
Jury to every enslavement - dedicated to Swat victims
»
Alice and Bob song (c.f. Cryptography)
»
Pakistan's IT negligence & ignorance - a national security risk
»
Hey, lets have a "TeaBreak Toolbar"!
»
America's Black President and the swine flu
»
Guy Kawasaki's Talk @ Informatics Venture Live Coverage
»
Cloud-based Software Architecture
»
Of facts and hyprocrisy: What happens in Swat stays in Swat?
»
Pull a prank, a website that answers *ANYTHING* you ask
Page:



C# Windows Service for sending text messages (SMS) from a cell phone
Sat, 24th January 2009 - 02:05 PM   |   4203 views   |  comments

Last year we (the TeaBreak team) thought of holding a Hi-Tea event for bloggers in Pakistan. We agreed that it would a nice idea to ask bloggers RSVP online so that we can keep things in order. The event went good but the good part was also an SMS-based RSVP system!

A couple of hours of coding and I came up with a small script that would take a person's name, email and mobile number. The script will later send an SMS containing a unique ticket number. The ticket number served as an entry pass as we had limited seats for the event. Those who signed up for RSVP got a tid bit surprised with SMS mechanism, although I thought it to be quite primitive.

Here's the C# Windows Service that was running on my computer back then that was sending all the SMSes to folks. The service would connect to a MySQL database on my hosted server and fetch any pending messages (SMSes) that were to be sent. I hooked up my old Samsung phone with a serial data cable to my computer.

I thought to share it here just in case if anybody is looking for enjoying some kind of SMS feature in their applications.

Click here to download the C# code

(I am only uploading the class file rather then the complete VS project - SMSController.cs - you can build it in a windows service or whatever you prefer)

Pointers on how SMS sending and receiving works:

  1. You connect a GSM modem or a mobile phone to your computer which appears as a communication port (COM1, COM2, etc.)
  2. You send extended "AT" commands to the COM port to communicate
  3. Here's a tutorial on the "AT" commands for GSM modems/phones:
    http://www.developershome.com/sms/atCommandsIntro.asp

This is just a very basic class, if you need help on multimedia messages (MMS) support, or come across some issues etc. you can get in touch with me.

 

If you like the post, please share and help me spread the word. Thanks.

Readers' COMMENTS (6)

Rakesh says:
Cool post Sim. Will try this one out.
Asim says:
Thanks man :)
ijlal says:
very nice and useful sharing. thanks alot.
Asim says:
Welcome and Thanks, Ijlal.
coagantus says:
Hi,
Nice
Sharing...

www.coagantus.co.cc
www.jobs-for-online.co.cc
Faheem says:
Hello,
I like ur post and it is very relevent to the
problem i m having. i just need another function to recieve
an sms. i ll be thankful if u coulg help me
out
Regards,
Faheem.

Post COMMENT
Your name:
Your email:
Your website:
Your comment:
Not allowed: HTML, script

Word Security:
This step has been introduced to intercept automated submission attempts. Please enter the word as shown in the image below (case-insensitive):

Enter Word as shown above:

 
Creative Commons License