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.
- Are you a student and working on Project ?
- Are a Professional developer and working on some startup project ?
- 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:
- Create your free Twilio Account
- Get the number for your account, its completely free
- Go to Api Explorer
- Test the number using Api Explorer
- Verify Few Numbers For testing
- 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 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="java.net.*,java.io.*,java.net.URLEncoder;"
contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<html>
<head>
<title>index</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
</head>
<body>
<%
/* 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="http://www.someapiurl.com/smsapi.php?email="
+email+"&user="+user+"&pass="+pass+"&number="+number+"&msg="+
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;) {
out.println(line);
}
}
finally {
if (reader != null) try { reader.close(); } catch (IOException ignore) {}
}
%>
</body>
</html>
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