Click here to Skip to main content
12,952,792 members (40,278 online)
Click here to Skip to main content
Add your own
alternative version


103 bookmarked
Posted 19 Jul 2006

Implementing an SMS Quiz Server Using a GSM Modem Enabled Mobile Phone

, 19 Jul 2006 CPOL
Rate this:
Please Sign up or sign in to vote.
A very simple application that uses SMS to send quiz questions and receive answers and notify winners at the end of the day using a Nokia 6610i and mCore.
Sample Image - SMSQuizServer.jpg


This is a great tool to play with SMS, especially when it comes to sending messages to your near and dear ones. Everyone loves it more or less. For years, I have been using SMS without caring much how it really works. Recently, I discovered that using this small technology, some interesting work can be done. I always wondered how SMS quiz is implemented as shown on television or in the newspaper until I found my own developed SMS server with my Nokia 6610i. I came up with an idea of a Quiz Server which is implemented using .NET and SMS.

A Very Few Words about SMS (Short Message Service)

SMS stands for Short Message Service. It is a technology that enables the sending and receiving of messages between mobile phones. SMS first appeared in Europe in 1992. It was included in the GSM (Global System for Mobile Communications) standards right at the beginning. Later it was ported to wireless technologies like CDMA and TDMA. The GSM and SMS standards were originally developed by ETSI. ETSI is the abbreviation for European Telecommunications Standards Institute. Now the 3GPP (Third Generation Partnership Project) is responsible for the development and maintenance of the GSM and SMS standards.

A Little About mCore

mCore™ SMS is a powerful and easy to use ActiveX Component that can be used in your Windows applications and ASP Web pages for mobile messaging using GSM mobile phones or GSM modems connected to serial port or infrared port. Using mCore in your applications allows you to:

  • Send text messages
  • Read incoming text messages
  • Send WAP Push
  • Set various messaging and network parameters (PIN, SMSC, Message Memory, etc.)
  • Read modem and network information (Manufacturer, IMEI, Model, Signal Strength, etc.)

A rich set of properties, methods and its compatibility with wide range of GSM mobile phones and GSM modems makes mCore™ the best choice for any type of mobile messaging application.

The Project

It is not a core project and most intellectual peoples out there will think it as a newbie project but it is really a great playing tool for beginners. In the beginning, I found that I can download photos and upload applications with the Nokia PC Suite, I wondered how I could send SMS using my own program. After several Google searches, I found Nokia PC Suite Connectivity API 1.1. I was unable to use it properly because I have very little knowledge about the development suite. However, I began searching again. I came across AT commands. I was feeling like I was in the middle of MS DOS 6.2 age. The white window was distracting me a lot. I only wanted to send or receive SMS and do some magic with it. I was searching with all my fingers and all the keywords. I was searching for a .NET compliant thing that would ease my task.

At last I found mCore from here. I fell in love with the component. It was love at first sight and I eventually knew it was the right thing for my work. It had detailed help and a wonderful demo project. I began to tweak and made my first Quiz Server that was able to process and notify winners of a Quiz session daily.

The Quiz Server scans for users who sent SMS to get a question every day. At the end of the day, a random user is chosen among all the users who have given the correct answer.

The Ingredients

  • Nokia phone with GSM modem
  • Serial Cable
  • mCore from here

The Procedure

  1. Start/Run the project by pressing F5 and wait infinitely after connecting.
  2. A user sends a SMS with QUES.
  3. The server scans each message and parses to find the request of question and sends the question of the day.
  4. If the user sends SMS with ANS A.
  5. The server records the answer. User cannot send several answers.
  6. At the end of the day, a random user is chosen and a prize SMS is sent to him/her.

The admin of the server can change the question of the day very easily.

Sample screenshot

The Core Code

In the following code, the server scans for all messages in the inbox and sends them to ProcessSMS to parse and save the data. After the message has been parsed, the message is deleted.

private void GetMessageFromMobile() 
     objSMS.MessageMemory = SMS.EnumMessageMemory.SM; 
     mCore.Inbox objInbox = objSMS.Inbox(); 
     for (int i = 1; i <= objInbox.Count ; i++) 
         txtNumber.Text = objInbox.Message(i).Phone.ToString(); 
         txtMessage.Text = objInbox.Message(i).Text.ToString(); 
         bool status = ProcessSMS(txtNumber.Text, txtMessage.Text); 
         if (status == true) 
             // Delete the Message that has already being parsed 

This part connects the application with the mobile. Make sure you know the Port number and the SMSC numbers. If you do not know the port name, go to the device manager in My Computer and see the properties in the GSM modem of your mobile phone.

private void btnConnect_Click(object sender, EventArgs e) 
         btnConnect.Enabled = false; 
         objSMS.Port = "COM7"; 
         objSMS.BaudRate = SMS.EnumBaudRate.BaudRate_115200; 
         objSMS.DataBits = SMS.EnumDataBits.Eight; 
         objSMS.Parity = SMS.EnumParity.None; 
         objSMS.StopBits = SMS.EnumStopBits.One; 
         objSMS.FlowControl = SMS.EnumFlowControl.None; 
         objSMS.PIN = "1234"; 
         objSMS.SMSC = "+880150159999"; 
         lbxStatus.Items.Add(objSMS.Model + " Connected "); 
         MyTimer.Interval = 10000; 
         btnDisconnect.Enabled = true; 
     catch (Exception ex) 
         btnConnect.Enabled = true; 

This timer scans for messages and processes the winner for the previous day. It also refreshes the inbox. Without refreshing the inbox, new messages will not be detected.

private void MyTimer_Tick(object sender, EventArgs e) 
     if(objSMS.Inbox().Count > 0) 

The Server in Action

Sample screenshot


Good things do not always come for free. I have used mCore which is not free of cost. It sends a message at the bottom of the real message with Powered by at the end of each message sent. So if you don't want the message, please buy the component from You can also write the component by communicating with the serial port with any programming language. Well, that is another story. And, most important is, why invent wheels when it's already there.

Lastly, using a mobile phone or GSM/GPRS modem to send SMS messages has a major drawback, that is the SMS sending rate is too low. Only 6-10 SMS messages can be sent per minute (when the "SMS over GSM" mode is used). The performance is not affected by the connection between the computer and the mobile phone or GSM/GPRS modem (i.e. the SMS sending rate is about the same no matter whether the mobile phone or GSM/GPRS modem is connected to the computer through a serial cable, USB cable, Bluetooth link or infrared link) and does not depend on whether a mobile phone or GSM/GPRS modem is used (i.e. the SMS sending rate is about the same no matter if a mobile phone or a GSM/GPRS modem is used). The determining factor for the SMS sending rate is the wireless network.


This project will inspire people who have limited components to test and who want to use a SMS based server at home. This project will eventually lead novice programmers to build more useful and robust SMS based applications. I will refine the code or sort out the buggy things if someone wants to learn or share more of it. Till then, Ba-Bye.


  • 19th July, 2006: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Zakaria Bin Abdur Rouf
Web Developer
Bangladesh Bangladesh
Zakaria has a keen interest in developing new solutions and exploring new technologies. He has a wide experience in web technologies and business solutions.

His latest project includes Library Management System for University of Dhaka using ASP.NET and Sql Server.

Zakaria completed Masters in Information Technology from Institute of Information Technology,
University of Dhaka, had his BSc in Computer Science from AIUB (
School and college from SKBZBIS (

Latest Project :
for Alam Group of Companies, Abu Dhabi

Some of his Completed projects: (The official website of Embassy of the People's Republic of Bangladesh, Abu Dhabi, United Arab Emirates)

Bangla Translation of the Holy Quran (C#/Access)
Library Management System (ASP.NET/C#/SQLServer)
Seat Reservation System (ASP.NET/C#/SQLServer)

Besides programming, he has published his first poetry book (na bola kothamala/Unspoken Words) and in the process of writing several new novels.

Founded ZakaSoft, a division of ZCom, Providing state-of-the-art solutions in United Arab Emirates.

Zakaria Lives in Abu Dhabi and enjoys his spare time in writing and music.

You may also be interested in...


Comments and Discussions

QuestionMessage Removed Pin
Member 1075791621-Apr-15 1:19
memberMember 1075791621-Apr-15 1:19 
QuestionCan you send Arabic/Bangla Unicode? Pin
Humayun Rashed17-Feb-15 17:17
memberHumayun Rashed17-Feb-15 17:17 application Pin
Gary Roland23-Jan-13 9:38
memberGary Roland23-Jan-13 9:38 
GeneralMy vote of 5 Pin
Member 43208441-Mar-12 9:29
memberMember 43208441-Mar-12 9:29 
QuestionmCore Error Msg Pin
seagun2-Jul-11 9:06
memberseagun2-Jul-11 9:06 
GeneralMake calls and send sms with usb modem Pin
4x2bit29-Apr-11 0:32
member4x2bit29-Apr-11 0:32 
Questioncan any one help Pin
haider_IT8-Jun-10 19:15
memberhaider_IT8-Jun-10 19:15 
GeneralQuestion regarding getting the status report whether a message is read or not Pin
sabarslan18-Sep-09 10:22
membersabarslan18-Sep-09 10:22 
GeneralHelp Pin
Jeffreychou4-May-09 15:51
memberJeffreychou4-May-09 15:51 
Generalserver sms Pin
khadija_y_2123-Apr-09 6:40
memberkhadija_y_2123-Apr-09 6:40 
GeneralSend SMS using CDMA Modem Pin
Asutosha6-Apr-09 0:06
memberAsutosha6-Apr-09 0:06 
Generalurgent Pin
jo_77729-Jan-09 3:24
memberjo_77729-Jan-09 3:24 
Generalhelp Pin
jo_77729-Jan-09 2:46
memberjo_77729-Jan-09 2:46 
GeneralERROR !! Pin
anilbpai17-Jan-09 4:28
memberanilbpai17-Jan-09 4:28 
GeneralRe: ERROR !! Pin
tempdoc8-Apr-12 10:40
membertempdoc8-Apr-12 10:40 
GeneralNice one !!! Pin
dnpro3-Jun-08 0:48
memberdnpro3-Jun-08 0:48 
GeneralERROR 2002: Error setting selected message memory Pin
Ms. Payal15-May-08 2:19
memberMs. Payal15-May-08 2:19 
GeneralRe: ERROR 2002: Error setting selected message memory Pin
sensisoft14-Aug-08 13:01
membersensisoft14-Aug-08 13:01 
QuestionConnecting to USB modem Pin
abbas layeghi4-Nov-07 3:11
memberabbas layeghi4-Nov-07 3:11 
QuestionRe: Connecting to USB modem Pin
Aram Azhari13-Apr-08 20:34
memberAram Azhari13-Apr-08 20:34 
QuestionProblem with PIN Pin
Member #235613511-Feb-07 22:15
memberMember #235613511-Feb-07 22:15 
AnswerRe: Problem with PIN Pin
Zakaria Bin Abdur Rouf12-Feb-07 6:15
memberZakaria Bin Abdur Rouf12-Feb-07 6:15 
GeneralRunning without a connected mobile phone Pin
xaml.net13-Jan-07 2:08
memberxaml.net13-Jan-07 2:08 
Questionwhat s PIN Pin
hamid_m21-Oct-06 1:32
memberhamid_m21-Oct-06 1:32 
AnswerRe: what s PIN Pin
Colin Angus Mackay21-Oct-06 1:51
memberColin Angus Mackay21-Oct-06 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 19 Jul 2006
Article Copyright 2006 by Zakaria Bin Abdur Rouf
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid