Friday, 4 January 2013

sending SMS from .Net using Way2SMS Gateway



Description: you can send free sms by using way2sms gateway from your .Net Application. Here, Just you need to give your login credentials of way2sms.com from your app.

Implementation:
Step 1: Design you UI based on your requirement. Here for your reference I took two input  textbox’s and which one is for accepting mobile number and another one is for message.


Step 2: Go to code window and define 4 local variables of string type, which are username,Password,Message and Mobile number.
Step 3: Now Download way2sms dll file from source click here. And save it into your local drive.

Step4: open your project and select Add Reference in Solution Explorer and select browse option and select smsClient.dll file

Step5 : Go to your code and write following code in button click event.
        
        SendSms newSms = new SendSms();
       string status = string.Empty;
                status = newSms.send(userName, passWord, txtMsg.Text, txtMobileNo.Text);
        if (status == "1")
        {
            lblResult.Text = "Message sent successfully";
        }
        else
            lblResult.Text = status;

Step 6: send() of SendSms class is required 4parameters as follows,

public string send(string uid, string password, string message, string no);

Step 7 : Now you can enjoy to send SMS. and you can find full source code here

27 comments:

  1. Thankyou very much sir for the smsClient.dll file , ive been searching for the file for almost 2 days and finally got it through your site. other sites took me to the skydrive or some other sites which always failed loading the file or gave some error.

    ReplyDelete
    Replies
    1. Hi scary, let me know if you looking for any help.

      Delete
    2. Hello Siva, i tried with the SmsClient.dll file and the code as follows :
      In a WPF Applications Project on .net 4.0 :

      using system.....
      using using SmsClient;
      namespace EasyWaytosmsApplication
      {
      ///
      /// Interaction logic for MainWindow.xaml
      ///
      public partial class MainWindow : Window
      {


      private void button1_Click(object sender, RoutedEventArgs e)
      {
      SendSms message = new SendSms();

      string var = message.send(Username.Text,Pass.Password,Msg.Text, MobNo.Text);
      if (var == "1")
      {
      MessageBox.Show("Message Sent Successfully");
      }
      else if (var == "2")
      {
      MessageBox.Show("Check your Internet Connection");
      }
      else {
      MessageBox.Show("Userid and Password Invalid");
      }
      }
      }
      }

      I have a way2sms login id and password when accessing through the browser it logs in but when executing this code in VS2010 it gives me an error saying "Userid and Password Invalid" or "Check your Internet Connection".. i have also added dll reference to the project.

      any idea why is it not working

      Delete
  2. Please Help me with that.........

    ReplyDelete
  3. Hey sorry for late reply..
    I tried with above code & its working cool..
    that is status error...

    which says that the problem is with internet connection or login credentials...

    ReplyDelete
  4. Hi Scary,

    This is trial and it has expired.. you can have paid version from them..

    ReplyDelete
  5. Hi Siva, Can it work for .NET Framework 3.5 ? If not do you have dll version which is compatible with .NET Framework 3.5.

    ReplyDelete
  6. hi sir,
    i got status -11 error.wat can i do..please help me out

    ReplyDelete
  7. status 11 is for unsupported providers..

    ReplyDelete
  8. I am also facing same status -11 error

    ReplyDelete
  9. hi siva am not getting any error but the message was not sending..please can you hepl me..

    ReplyDelete
  10. this code is not working error="Check your Internet Connection".
    if i try wrong username & password then error="Check your Internet Connection".

    Give me Correct Code...

    ReplyDelete
  11. I am not getting any error but when i click on Send message button, Label is displaying "2".. Messing was not sending.. So can you please help me..

    ReplyDelete
  12. YOU CODING C# NOT RUNNING

    ReplyDelete
  13. Hello Sir'
    I am getting error 2 pls help me as soon as...

    ReplyDelete
  14. Replies
    1. please sir give me Reply As Soon as Possible

      Delete
  15. it is not working always showing status==2
    how can i slove

    ReplyDelete
  16. always status =2
    ...
    why this gives???????????????

    ReplyDelete
  17. status=2 error even if i have internet connection

    ReplyDelete
  18. SIVA RAMAMOORTHY sir, I am not able to download the way2sms dll file sir.. Please suggest me the either way sir.
    Thank you in advance.

    ReplyDelete
  19. status=2 error even if i have internet connection

    ReplyDelete