0% found this document useful (0 votes)
50 views

Sending SMS Via Windows Forms Application

This article shows how to send SMS messages from a Windows Forms application using a free web API from Clickatell.com. The process involves registering for an account on Clickatell to get an API ID and sample code. The code uses the WebClient class to call the Clickatell API URL with the to number, message, user ID and password. If successful, a message is displayed confirming the SMS was sent.

Uploaded by

Brahmesh Mandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Sending SMS Via Windows Forms Application

This article shows how to send SMS messages from a Windows Forms application using a free web API from Clickatell.com. The process involves registering for an account on Clickatell to get an API ID and sample code. The code uses the WebClient class to call the Clickatell API URL with the to number, message, user ID and password. If successful, a message is displayed confirming the SMS was sent.

Uploaded by

Brahmesh Mandya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Sending SMS Via Windows Forms Application

By Safayat Zisan on Apr 22 2015


This article shows how to send SMS messages via Windows Forms applications using a Web API.

expand
Download Files:

BULKSMS.zip

Download 100% FREE Spire Office APIs


For sending SMS messages from your Windows or web form application you will need a web API. There are
some websites for API purchase. Some websites provide an API for free. Here I will show you how to use them
and sending messages to a mobile network using the API.
Step 1
I have used a web API from www. clickatell.com. The process is pretty straight forward. First of all, you need to
register in the website.

Click on, GET STARTED FOR FREE.

Click on, Developers' Central. And provide the basic information during the registration process. After
completing the registration, a mail will be sent by them to your E-Mail address. Like this:

Here they will give you a Client ID for the API. Click on the click here link. They will automatically give you the
string for sending the message using the API.

Copy the sample code and save it.


Step 2
Open your Visual Studio and create a Windows Forms application project and name it. Here is mine:

The code behind this scenario is pretty cool. You just need the code they have given you. For using the API,
you need to make an object of the WebClient class. And using this object, all the web APIs can be used under
specific conditions. For the WebClient class you need to import a library writing Using System.Net at the field
level. Here is the button click code:
1.

try

2.

3.

WebClient client = new WebClient();

4.

string to, message;

5.

to = textBox1.Text;

6.

message = textBox2.Text;

7.

string baseURL = "http://api.clickatell.com/http/sendmsg?


user=zisan94268&password=OYeNLVUHTNIHbD&api_id=3528011&to='" + to + "'&text='" + message + "'";

8.

client.OpenRead(baseURL);

9.

MessageBox.Show("Successfully sent message");

10. }
11. catch (Exception exp)
12. {
13.

MessageBox.Show(exp.ToString());

14. }

Remember, the baseURL string is the same as they have provided. You need to replace the User Name,
Password and API ID.

If everything is OK, then the message will be sent to the number you inserted.
Thank you for reading.
Have a nice day.
Download 100% FREE Spire Office APIs
Send SMS using Web API Sending SMS Windows Form Application

http://bulksmsgateway.in/bulksms-offer-prices/

You might also like