Send Bulk SMS using C# Code

Send Bulk SMS using C# Code

How to Send SMS API using C# code

This is just an example SMS API code for C# programming language, please make sure to sanitize data and other security aspects at the time of actual development.

Send Bulk SMS using C#

Sample scripts are provided just for reference only, do not develop using the same code.

Download Text File

//Sample C# Code for sending a single message
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;
namespace BulkSMSGatewayAPI{
    class Program{
        static void Main(string[] args){
        string result = "";
            WebRequest request = null;
            HttpWebResponse response = null;
                String sendToMobileNumber = "9xxxxxxxxx"; //Recipient Phone Number
                String username = "myusername";
                String password = "xxxxx";
                String senderName = "MYCOMP";
                String url = "" + username + "&Password=" + password + "&Type=Individual&To=" + sendToMobileNumber + "&Mask=" + senderName + "&Message=Hello";
                request = WebRequest.Create(url);
                //in case u work behind proxy, uncomment the commented code and provide correct details
                /*WebProxy proxy = new WebProxy("http://proxy:80/",true);
                proxy.Credentials = new
                NetworkCredential("userId","password", "Domain");
                request.Proxy = proxy;*/
                // Send the 'HttpWebRequest' and wait for response.
                response = (HttpWebResponse) request.GetResponse();
                Stream stream = response.GetResponseStream();
                Encoding ec = System.Text.Encoding.GetEncoding("utf-8");
                StreamReader reader = new
                System.IO.StreamReader(stream, ec);
                result = reader.ReadToEnd();
            } catch (Exception exp){
            } finally {
                if (response != null)

Go Back! SMS Developers API

Save this interesting page on your Favorite Social Media

Premium Bulk SMS Gateway

SMS Pricing

Receive a Call


SMS Business Opportunities

Bulk SMS Know-how

Convinced? Get an estimate. Contact Now!