ARTICLE
Send SMS Using C# .Net
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:
- Active Internet connection
- Download the SMSClient DLL (Here)
- Visual Studio 10 (Visual Studio 2010) or above (the SMSClient DLL works only in Visual Studio 10 or above)
- .Net 4.0 or above
Now here are some easy steps to follow.
- Create a new C# Windows Application

- Design your application page something like this:

- Now add a reference for the SMS Client Dll, as in:
Projects -> Add reference -> Browse -> select your SMS client DLL

- 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:
- An active internet connection is required.
- The .Net 4.0 Framework is needed with Visual Studio 10
- 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.
Article Extensions
I wrote the code as below in vb.net
Imports SmsClient
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Dim sample As New SendSms()
Dim str As String = sample.send("XXXX", "XXXX", "Test from VS2010", "XXXXX")
'Here i've replaced my authentication details as X for security purpose
If str = "1" Then
MessageBox.Show("Message Send")
ElseIf str = "2" Then
MessageBox.Show("No Internet Connection")
Else
MessageBox.Show("Invalid Login Or No Internet Connection")
End If
Catch ex As Exception
MessageBox.Show(ex.ToString())
End Try
End Sub
End Class
When i run the application it will return no internet connection error. I've the active internet connection but in the proxy mode. ie., i've to give my authentication details inorder to connect internet. So how can i achieve this? do i mention any code to access through proxy server. Kindly check and revert.
Regards,
Sathish.J
I have follow the same instruction as u given ...
bt still it returns the result status -11...
plz give me solution for it..
thanx in advance..
Its not working.Its giving error status -1. I used this given code.I used right username and password.SO give me solution on yogeshdotnet@gmail.com
message send Message Display but Message Was not Receive
your code is not working properly.........