Click here to Skip to main content
15,314,644 members
Articles / Programming Languages / C#
Posted 7 Jun 2004


178 bookmarked

Sending SMS using .NET through a Web service

Rate me:
Please Sign up or sign in to vote.
2.87/5 (87 votes)
7 Jun 20043 min read
This article will help you to know how to use web services in .NET

Image 1


This article is about sending SMS using .NET through web service. With the help of this article we can easily understand how to use web service in .NET and also you will get some information about SMS, GPRS etc. This web service will help you to give the notification if the service unable to deliver.

How does it work?

Initially when undergoing this study I think sending SMS to different services will be a problem, for sending SMS we have to tie up with all the services it is not possible at all, while studying this most of the services provides GPRS(General Packet Radio Service ) facility. GPRS has more functionality and here we are going to use only one that is Internet email services. So it makes our work little easier. After that I think how to find out the services for that particular mobile number. Now it became very critical, then I found a web service that provides us all the information that we needed. Let we discuss in upcoming paragraph.

What is GPRS?

With GPRS you can enjoy a continuous wireless connection to data networks and access your favorite information and entertainment services. GPRS technology allows mobile phones to be used for sending and receiving data over an Internet Protocol (IP)-based network. GPRS as such is a data bearer that enables wireless access to data networks like the Internet. The applications using GPRS are WAP, MMS, SMS, Java and the PC dial-up (for example, Internet and e-mail).

Internet email services come in the form of a gateway service where the messages are not stored, or mailbox services in which messages are stored. In the case of gateway services, the wireless email platform simply translates the message from SMTP, the Internet email protocol, into SMS and sends to the SMS Center. In the case of mailbox email services, the emails are actually stored and the user gets a notification on their mobile phone and can then retrieve the full email by dialing in to collect it, forward it and so on.

Upon receiving a new email, most Internet email users do not currently get notified of this fact on their mobile phone. When they are out of the office, they have to dial in speculatively and periodically to check their mailbox contents. However, by linking Internet email with an alert mechanism such as SMS or GPRS, users can be notified when a new email is received.

For more information about GPRS click here

Using the code

In this article I am using a web service which already exists. Since this web service is tie up with ICQ instant messaging service make our work easier. With the help of this web service we can able to send SMS to various countries like India, US, UK, Malaysia, Japan etc. In this article I have used the web service from they are providing Webs Service Definition Language (WSDL) link for sending SMS.

Here I m attaching the sample code for sending SMS.

private void Send_Click(
 object sender, System.EventArgs e)
      { smsIndia= 
          new; smsWorld =  
        if(rdoType.SelectedValue == "1")
            txtEmailId.Text.Trim(), txtMessage.Text);
           txtCountryCode.Text.Trim(), txtMobileNo.Text.Trim(), 
        lblMessage.Visible = true;
        lblMessage.Text="Message Send Succesfully";
      catch(Exception ex)
        lblMessage.Visible = true;
        lblMessage.Text="Error in Sending message"+ex.ToString();

    private void rdoType_SelectedIndexChanged(
     object sender, System.EventArgs e)
      if(rdoType.SelectedValue =="1")
        txtCountryCode.Enabled = false;
        txtCountryCode.Enabled = false;



The most important feature is it will give mail alerts if the SMS is not send to the user. And it will not support all the services which has GPRS facilities.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Manoj Kumar C
Web Developer
United States United States
I have done Bachelor in Mechanical Engineering. I have strong background in C#, ASP.NET, SQL server 2000. And i also worked in some small application in Mobile.NET and CF.NET

Comments and Discussions

Questionhow send sms in vfp Arabic Pin
mhakimi15-Feb-19 6:30
Membermhakimi15-Feb-19 6:30 
Questionhow send sms in vfp arbic Pin
mhakimi15-Feb-19 6:30
Membermhakimi15-Feb-19 6:30 
QuestionIt's not working sir Pin
Sudhanshu_Tiwari15-Jan-18 20:23
MemberSudhanshu_Tiwari15-Jan-18 20:23 
Questionsend sms app for android Pin
Member 131762482-Aug-17 20:28
MemberMember 131762482-Aug-17 20:28 
BugDoesn't work Pin
James A. Young21-Jul-16 6:38
MemberJames A. Young21-Jul-16 6:38 
QuestionNot working Pin
Giridhar Madhavan20-Jun-16 22:52
MemberGiridhar Madhavan20-Jun-16 22:52 
QuestionError using world WSDL Pin
fihsak10-Apr-16 0:56
Memberfihsak10-Apr-16 0:56 
QuestionMVC Pin
Member 1192493320-Aug-15 21:07
MemberMember 1192493320-Aug-15 21:07 
Questionsms send Pin
Rai Neha2-Apr-15 13:59
MemberRai Neha2-Apr-15 13:59 
QuestionQuery Pin
Goutham Bhamidipati23-Jan-15 23:20
MemberGoutham Bhamidipati23-Jan-15 23:20 
QuestionIt is not working. I have given web service reference also. Pin
Sandeep Reddy Badikolu18-Nov-14 0:44
MemberSandeep Reddy Badikolu18-Nov-14 0:44 
Questionsms send successfully but i wont received any msg nor any email......its not working..plz can u help me Pin
sandeshmanohar2711-Oct-14 23:43
Membersandeshmanohar2711-Oct-14 23:43 
QuestionIncorrect code Pin
Kishan Zunjare12-Mar-14 0:30
MemberKishan Zunjare12-Mar-14 0:30 
Questionsms api Pin
rahulpnd8735-Mar-14 0:40
Memberrahulpnd8735-Mar-14 0:40 
QuestionProblem with coding Pin
Anish Joy13-Feb-14 23:46
MemberAnish Joy13-Feb-14 23:46 
QuestionNot Working Pin
Varun Raghunandan15-Jan-14 7:15
MemberVarun Raghunandan15-Jan-14 7:15 
QuestionNot working Pin
vikuseth12-Dec-13 4:59
Membervikuseth12-Dec-13 4:59 
QuestionNo Funciona.! Pin
jesus Laborda18-Oct-13 12:49
Memberjesus Laborda18-Oct-13 12:49 
QuestionSending SMS using .NET through a Web service Pin
rajeshkool13-Oct-13 23:23
professionalrajeshkool13-Oct-13 23:23 
Questionfor creating our own web service for send a text message Pin
Member 100019237-Aug-13 7:05
MemberMember 100019237-Aug-13 7:05 
GeneralMy vote of 1 Pin
waris kantroo28-Jun-13 21:35
Memberwaris kantroo28-Jun-13 21:35 
QuestionProblem with the code Pin
ankur78919-Dec-12 0:27
professionalankur78919-Dec-12 0:27 
GeneralWeb2SMS Pin
civijas21-Nov-12 1:36
Membercivijas21-Nov-12 1:36 
Question??? Pin
sarfaraznavaskhan2-Oct-12 23:55
Membersarfaraznavaskhan2-Oct-12 23:55 
QuestionNot Working Pin
Member 79212172-Oct-12 22:02
MemberMember 79212172-Oct-12 22:02 

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.