How To Send SMS Using JAVA

In the past few years i have seen many Developers asking the question that “how they can send sms using JAVA/PHP/C#/Python and any other language ?“. I n the past i developed API for sending sms using some free API’s like way2sms, but that’s not the case anymore because they made it more secure. So i decided to find out the alternatives and i got a few ways which can help you but these solutions depends on your exact requirements. Let me ask you few questions first.

  1.  Are you a student and working on Project ?
  2. Are a Professional developer and working on some startup project ?
  3. Are you working on a company Projects ?

I asked these question because each of them have a different solutions.

How to Send SMS completely free only  applies for students

This is easy but the only limitation imposes here is you have to verify each number on providers site, which will definitely work for a student because they need is this just for testing project and demoing their projects in the exam.

Steps to follow:

  1. Create your free Twilio Account
  2. Get the number for your account, its completely free
  3. Go to Api Explorer
  4. Test the number using Api Explorer
  5. Verify Few Numbers For testing
  6. Copy the exact code for your need. They have code samples for Java, PHP, C#, Python, Ruby
How to Send SMS using Java-PHP

How to Send SMS using Java/PHP

How To Send SMS using paid API’s

if you are a professional developer or working for any company then you can afford to pay a very small amount for testing or deployment purpose. you can choose either the Paid version of  twilio and follow the same process  or you can use any other alternative provider’s API.

All the provider mostly use direct URL based API’s where you have to send some authentication code along with sms details and it goes pretty easy . you can achieve that Using CURL.

Please Share it, if you found this post helpful in your development process.

Sample Code for JSP

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@page
 language="java" import="*,*,;"
contentType="text/html; charset=ISO-8859-1"

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
/* This api is only for developemnt purpose, 

String email="put your email id here";
String user=" your username";
String pass=" your password";
String number="some number on which you want to send msg";

String msg="your message to send" ;

String mURL=""
URLEncoder.encode(msg, "UTF-8");;

URL url = new URL(mURL);
BufferedReader reader = null;

try {

reader = new BufferedReader(new InputStreamReader(url.openStream(), "UTF-8"));

for (String line; (line = reader.readLine()) != null;) {

finally {
if (reader != null) try { reader.close(); } catch (IOException ignore) {}

Search Terms : how to send sms using PHP,how to send sms using JSP, how to send sms using c#, how to send sms using curl, how to send sms using Python,Sending SMS to mobile using java program, Sms web application, sms mobile, Send sms from java application, Sending SMS from a servlet, How to Send SMS using Java Program, How to send sms in JAVA through HTTP

Tags:, , , ,

Add a Comment

Your email address will not be published. Required fields are marked *