If you have used the Free SMS web service already and craved a java version, it is here 🙂 . You can now send SMS from within your program by calling a simple method. Just download this JAR file and include it in your class path. Java source code for the class file is present in the JAR archive itself. So, if required you can browse through it.

How to use:

Please note that you need to create a free account at www.way2sms.com before attempting to use the library.

Here’s a simple program on how to use the JAR.

import com.aswinanand.sms;

public static void main(String… args) {

SMS.send(“9933445566”, “password”, “9001122334;9887712345”, “message”);


SMS should be sent now. If there are any errors then an exception will be thrown.


This Java source code, the class file and the archive is licensed under “Creative Commons Attribution-Noncommercial”. License terms are here. Downloading the files means you agree to the license terms.


Download the sms.jar here.


Some immediate improvements are underway right now:

  1. Code cleanup.
  2. Organize the code in methods. Right now everything is in one big method.
  3. Invalid login notification.
  4. Support for authenticated proxy servers.

Change Log:

Version 0.2, 0.3:

  1. Implemented the major changes that happened at way2sms. Download here.

Version 0.1:

  1. First release with working code base for sending SMS through way2sms.

Please take it for a test drive and give feedback.

170 Responses to “Free SMS Web Service India – Java Library”

  1. Raam Says:

    Thank you very much pratik.

  2. arunkumar Says:

    Hi Aswin,I am trying to send sms directly by giving send()method and Main() method in same class and i kept a throws IOException for main() method in the same class SMS.java, but there is no error i found and i didnt get any sms..how it is possible can clearly send the code with explanation in java only..please give me reply thanku..

  3. arunkumar Says:

    my email id is arun.schoolmate@gmail.com.plz give me clear explanation.and java code.

  4. Ksk Says:

    Hi, i can successfully compile and run the program but, message not delived to desired mobile…. no exceptions… can U pls help to solve this problem… thanks in advance..

  5. Saurabh Says:

    for using this we need to be registered to way2sms.. is there any webservice thorough which we can directly register to it without going to the site.

  6. shameen Says:

    Hey guyzz, just check out http://www.beat2day.co.in and you will get everything that you want related to it. i found a code on it and it really helped me.. thanx to its makers..

  7. Tathagata Says:

    Hi Anand,

    I just used sms.jar file and run the code. It’s not giving any compilation error. The program is running successfully. But still not getting any SMS. So is there a way to find out the reason?

    When I am using waytosms it’s properly sending SMS. Did I miss something?

    My mail id : tbiddu@yahoo.com

  8. balamurugan Says:

    i have executed the above code. no errors but no result
    that is i didnt receive any sms

  9. Ksk Says:


    uc.setRequestProperty(“User-Agent”, “Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2008120122 Firefox/3.0.5”);

    what it represents. with out firefox our program can run??

    help me in this confusion

    My mail id:visitmyaccount@gmail.com

  10. ravi Says:

    Hey guyzz, just check out http://www.beat2day.co.in/default.aspx and you will get everything that you want related to it. i found a code on it and it really helped me.. thanx to its makers..

  11. utkarsh ADMIN-BEAT2DAY Says:

    hey checkout this…hope it solvs ur purpose…

    beat2day.co.in now provides an API to send SMS…


  12. Niket Talati Says:

    Thanks utkarsh it works…..
    thanks a lot…..

  13. Admin Says:

    now install on your mobile

    or maja lo fullonsms,way2sms,16by2,mycantos,site2sms

  14. Sebin Joseph Says:

    This program works. No runtime error or something..but no output to mobile device..What will be the reason? Can you help me?.