SMS delivery: What rate should you expect? How to optimize it. read the article SMS delivery: What rate should you expect? How to optimize it.read the article Entrega de SMS: ¿Qué tasa debe esperar? Cómo optimizarlo. leer el artículo Consegna degli SMS: quale tasso di consegna si deve prevedere? Come ottimizzarlo.per saperne di più SMS-Zustellung: Welche Rate ist zu erwarten? Wie man sie optimiert.mehr erfahren

focus smsmode©

focus on
SMS C#

You build an application in C# and you want to send SMS messages. With our HTTP API, realize in your development environment, sending messages on a mobile number via HTTP whether it is an alert message or a marketing action.

An SMS API compatible with the C# programming language is a gateway that allows you to connect directly to our SMS platform. Thus, you can send and receive SMS messages directly from any C# application.

To develop the SMS-sending functionality efficiently, see our Quick Start Guide...

Discover our API Documentation

SENDING C# SMS IN DETAIL
Integrating a free SMS gatewaySimple and quick API integration

Compatible with all programming languages with HTTP GET and POST requests, the complete and free documentation allows a simple, fast and step by step integration.

Maximum security for automated SMS sentMaximum security

Hosted in France, in a level 4 data-center, our SMS APIs guarantee maximum security, thanks in particular to the HTTPS protocol.

High Availability dedicated InfrastructureContinuous service

Our dedicated, high-availability infrastructure is continuously monitored 24/7/365 with fail-safecapability.

Support Team at your disposalTechnical support at your disposal

Our dedicated team of developers is available to help you integrate our SMS APIs or answer your questions.

Examples of SMS messages from C#

QUICK START GUIDE

How do I send SMS in C#?

Configuring our WebService in your C# development is quick and easy to set up. The following C# code example gives you a brief overview of how to add SMS functionality to your Web site or application.

using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using System.Text;
using System.Web;

/**
*    Function parameters:
*
*    - accessToken (required)
*    - message (required)
*    - destinataires (required): Receivers separated by a comma
*    - emetteur (optional): Allows to deal with the sms sender
*    - optionStop (optional): Deal with the STOP sms when marketing send (cf. API HTTP documentation)
*    - batchFilePath (required for batch mode): The path of CSV file for sms in Batch Mode
*/

namespace ExempleClientHttpApi
{
 public class ExempleClientHttpApi {

     private static string URL = "https://api.smsmode.com/http/1.6/";
     private static string PATH_SEND_SMS = "sendSMS.do";
     private static string PATH_SEND_SMS_BATCH = "sendSMSBatch.do";
     private static string ERROR_API = "Error during API call\n";
     private static string ERROR_FILE = "The specified file does not exist\n";
     private static readonly HttpClient _httpClient= new HttpClient();
 
     public ExempleClientHttpApi()
     {
         Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
     }

     // send SMS with GET method 
     public string sendSmsGet(string accessToken, string message, string destinataires, string emetteur, string optionStop) { 

         string urlEncodedMessage = HttpUtility.UrlEncode(message, Encoding.GetEncoding("ISO-8859-15"));
         string finalUrl = URL + PATH_SEND_SMS + "?accessToken=" + accessToken + "&numero=" + destinataires + "&message=" + urlEncodedMessage + "&emetteur=" + emetteur + "&stop=" + optionStop;
 
         return Get(finalUrl).Result;
     }

     public static async Task<string> Get(string url){

         try {
             var response = await _httpClient.GetAsync(url);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }

     // send SMS with POST method 
     public string sendSmsPost(string accessToken, string message, string destinataires, string emetteur, string optionStop) {

         string finalUrl = URL + PATH_SEND_SMS;

         StringBuilder sb = new StringBuilder();
         sb.Append("accessToken=" + accessToken);
         sb.Append("&numero=" + destinataires);
         sb.Append("&emetteur=" + emetteur);
         sb.Append("&message=" + HttpUtility.UrlEncode(message, Encoding.GetEncoding("ISO-8859-15")));
         sb.Append("&stop=" + optionStop);

         return Post(finalUrl ,Encoding.Default.GetBytes(sb.ToString())).Result;
     }

     public static async Task<string> Post(string url, byte[] data){

         ByteArrayContent byteContent = new ByteArrayContent(data);
         byteContent.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
         try {
             var response = await _httpClient.PostAsync(url, byteContent);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }

     // send SMS with POST method (batch)
     public string sendSmsBatch(string accessToken, string batchFilePath, string optionStop) {

         if (!File.Exists(batchFilePath)) {
             return ERROR_FILE;
         }
         string finalUrl = URL + PATH_SEND_SMS_BATCH + "?accessToken=" + accessToken + "&stop=" + optionStop;
         return PostBatch(finalUrl , File.ReadAllBytes(batchFilePath), batchFilePath).Result;
     }

     public static async Task<string> PostBatch(string url, byte[] data, string batchFilePath) {

         var requestContent = new MultipartFormDataContent();
         ByteArrayContent byteContent = new ByteArrayContent(data);
         byteContent.Headers.ContentType = MediaTypeHeaderValue.Parse("text/csv");
         requestContent.Add(byteContent, "file", batchFilePath);
         try {
             var response = await _httpClient.PostAsync(url, requestContent);
             string result = await response.Content.ReadAsStringAsync();
             return result;
         } catch (Exception) {
             return ERROR_API;
         }
     }
 }
}

source: https://stackoverflow.com/questions/4015324/how-to-make-http-post-web-request

 

The complete documentation of our HTTP API details all the features and queries available on our SMS gateway. The C# SDK will also allow you to configure the set of services such as: consulting the remaining credit, sending an SMS to multiple recipients, managing your contacts, scheduling the date and time of sending, sending notifications by SMS, the receiving statistics of the sent campaigns (status received), etc.

DOWNLOAD THE HTTP API DOCUMENTATION

Be aware that our SMS API is compatible with an ISO-8859-15 encoding and a dev in PHP, Java, ASP, C++, Ruby, WINDEV, etc.

Why use our SMS gateway?

As a player in the texting industry for nearly 20 years, we have developed capabilities and service guarantees that provide greater efficiency of our platform, improved performance and quality of texting service.

6 Advantages that our service offers:

1We offer a self-service
Without subscription or fixed fee, the use of our HTTP API is open source, free of charge and without commitment. Only the cost of the SMS sent (declining cost depending on the sending volume) will be charged!

2We are a telecom operator
Thus, SMS routing is carried out directly with the French operators (which excludes the use of roaming in France and world) and provides you with the most reliable service.

3We separate marketing and notification traffic
These 2 channels so treated independently offer optimized performance in terms of message priority, send throughput, STOP management, etc.

4We monitor in real time the performance of the sendings and the delivery times of the SMS
Through an alert and monitoring system based on ELK, we monitor instantly and continuously the state of the traffic passing through our webservice. You can check the service status of our system at any time via our StatusPage page.

5We have a range of effective SMS marketing tools
by being a customer smsmode©The SMS sending platform in SaaS mode with its intuitive interface allows you to manage your customer account. Moreover, additional modules and services are available for a more advanced use of the SMS marketing : reception server, database rental, voice messages, Google Calendar SMS module, white labeling, OTP passwordautomatic answering machine, etc. Ask our team for more information!

6We have an ultra-reactive support
Our customer service and support development teams are at your disposal to answer your technical questions, and to help you implement our API in your system. In addition, you can let your questions (of which you can follow the progress of the treatment) be made through the creation of a ticket on our Freshdesk service.

Tools and services for sending C# SMS

Gateway SMS Provider

Our team advises you...

Our sales and technical teams are at your disposal to answer all your questions about the implementation of C# SMS sending. As an SMS service provider for almost 15 years, you will benefit from our advice on setting up and our expertise in SMS mailings.

CONTACT US