Reader Level:
Article

Send SMS Using C# .Net

By Shivam Pandya on Oct 08, 2012
Here you can send SMS using the way2sms client library from your very own C# .Net Web/Window Application

Here I'm showing you how to send SMS using your C# .Net Application. Please use the following instructions and you are ready to go within 8-10 minutes.

Here some requirements for this application:

  1. Active Internet connection
  2. Download the SMSClient DLL (Here
  3. Visual Studio 10 (Visual Studio 2010) or above (the SMSClient DLL works only in Visual Studio 10 or above)
  4. .Net 4.0 or above

Now here are some easy steps to follow.

  • Create a new C# Windows Application

Window-form-application-C-Sharp.jpg

  • Design your application page something like this:

SMS-Client-page-in-C-Sharp.jpg

  • Now add a reference for the SMS Client Dll, as in:

Projects -> Add reference -> Browse -> select your SMS client DLL

Add-Reference-page-in-C-Sharp.jpg

  • Now put the following code in your "Send" buttons Click Event

First of all add a "using" for the smsclient dll, as in:

using SmsClient;

Now use this code to send the sms and check the internet status and whether users exist.

SendSms sms = new SendSms();

string status = sms.send(textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text);

if (status == "1")

{

MessageBox.Show("Message Send");

}

else if (status == "2")

{

MessageBox.Show("No Internet Connection");

}

else

{

MessageBox.Show("Invalid Login Or No Internet Connection");

}

  • Now run your application and enjoy
  • This application works as a charm, but it has some drawbacks which I described below:
  1. An active internet connection is required.
  2. The .Net 4.0 Framework is needed with Visual Studio 10
  3. The application works in India only because the Way2sms provides service in India only, but they say they will start services in other nations shortly, so after that we will be able to use this application for those nations too.

Shivam Pandya

Programmer @ Meghtechnologies, Vadodara India.

COMMENT USING