Integrating SMS in your web or desktop application

Web services make integrating SMS in your applications very easy. As always I would like to divide this into following steps:
Note: Here in this tutorial I am using FSMSAPI as SMS-gateway.Step 1: Get a domain name
Go and get a domain name. I personally recommend and set a email account by setting MX entries.

Step 2: Register on
Go to and register their. Start information will be mailed to you

Step 3: Get secret key
Login on . and get your secret key by scrolling down.

Step 4: Integration
As most web-services are technology independent , so is it. You can integrate it in any technology of your choice. Using FSMSAPI is so simple that requires only one URL request! Below goes the tech terms:

Parameters of URL
* skey – put your secret key e.g. d67ddf90df1019b0dd63b5f1842f6617
* message – proper url encoded message.
* recipient – whom to send, Can be comma seperated multiple values
* response – json or xml (default is xml)

For php:
Simply writing this works:

echo file_get_contents(“”.urlencode(‘YOUR MESSAGE’).”&recipient=MOBILE_NUMBERS”);

For java:
You have to write:

public class JavaGetUrl {
public static void main(String[] args) throws Exception {
URL myurl = new URL(“”);
BufferedReader in = new BufferedReader(
new InputStreamReader(
String inputLine;
while ((inputLine = in.readLine()) != null)

For C#:
.netties can go via following way:

using System.IO;
using System.Net;
string connectionString = “”;
System.IO.Stream SourceStream = null;
System.Net.HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(connectionString);
myRequest.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse webResponse = (HttpWebResponse)myRequest.GetResponse();
SourceStream = webResponse.GetResponseStream();
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
string str = reader.ReadLine();
catch (Exception ex)
{       MessageBox.Show(ex.Message);

Step 5: My recommendations(you may or may not follow this)
For php:
Write down the above code(d’t forget to set your own skey) after wrapping in a function in a file named smssender.php and include it wherever necessary in your script files using:


and make a proper function call.

For java and C#:
Just make a file and include it using below and make proper function call:

using yournamespace;

If you are on another technologies, then find a equivalent inbuilt function call in your technology of choice. OR get code in SMS API section of fsmsapi.
Happy integration!
I will be happy to solve any problem during this process, let me know via comments.

2 thoughts on “Integrating SMS in your web or desktop application

Leave a Reply

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