Vous souhaitez développer une application en C# qui permet d'envoyer des SMS ? Consultez nos exemples de codes pour chacune des fonctionnalités disponibles depuis notre API SMS.

				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/message/send";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "text=" + HttpUtility.UrlEncode("Nouveau message via l'API Envoyer SMS Pro depuis un script C#") + "&sendername=" + HttpUtility.UrlEncode("SOCIETE") + "&recipients=" + HttpUtility.UrlEncode("33600000000");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Message envoyé :" + Environment.NewLine + Environment.NewLine + "
" + "
"; readerXML.ReadToFollowing("message_id"); textResponse += "Le messageid :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Nombre de SMS :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } else { textResponse = "Impossible d'envoyer le message : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/message/stats";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "messageid=" + HttpUtility.UrlEncode("0");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Voici les statistiques de votre message : " + Environment.NewLine +  Environment.NewLine + "
"+ "
"; string currentNumber; string currentDate; string currentStatus; while(readerXML.Read()) { if(readerXML.IsStartElement()) { if(readerXML.Name == "number_status_1") { textResponse += readerXML.ReadElementContentAsString() + " SMS ont été délivrés" + Environment.NewLine + "
"; textResponse += readerXML.ReadElementContentAsString() + " SMS n'ont pas pu être délivrés" + Environment.NewLine + "
"; textResponse += readerXML.ReadElementContentAsString() + " SMS sont en attente chez l'opérateur" + Environment.NewLine + "
"; textResponse += readerXML.ReadElementContentAsString() + " SMS sont en cours de traitement" + Environment.NewLine + "
"; textResponse += readerXML.ReadElementContentAsString() + " numéros sont en STOP SMS" + Environment.NewLine + "
"; } else if(readerXML.Name == "mobile_number") { currentNumber = readerXML.ReadElementContentAsString(); currentDate = readerXML.ReadElementContentAsString(); currentStatus = readerXML.ReadElementContentAsString(); switch(currentStatus) { case "1": textResponse += Environment.NewLine + "
" + "Le " + currentNumber + " a reçu le SMS à " + currentDate; break; case "2": textResponse += Environment.NewLine + "
" + "Le " + currentNumber + " n'a pas reçu le SMS"; break; case "3": textResponse += Environment.NewLine + "
" + "Le " + currentNumber + " est en attente chez l'opérateur"; break; case "4": textResponse += Environment.NewLine + "
" + "Le " + currentNumber + " est en cours de traitement"; break; case "5": textResponse += Environment.NewLine + "
" + "Le " + currentNumber + " est en STOP SMS"; break; } } } } } else { textResponse = "Impossible d'envoyer le message : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
								string ENVOYER_SMS_PRO_URL = "/api/message/cancel";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "messageid=" + HttpUtility.UrlEncode("0");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Envoi du message annulé:" + Environment.NewLine + Environment.NewLine + "
" + "
"; readerXML.ReadToFollowing("message_id"); textResponse += "Le messageid :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Nombre de SMS recrédité :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant :" + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } else { textResponse = "Impossible d'envoyer le message : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/account/getallaccounts";
	
					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            WebResponse response = request.GetResponse();
					
					            Stream dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Voici vos comptes :" + Environment.NewLine + Environment.NewLine + "
" + "
"; while(readerXML.Read()) { if(readerXML.IsStartElement()) { if( readerXML.Name == "account") { textResponse += "------------" + Environment.NewLine + "
"; } else if( readerXML.Name == "account_id") { textResponse += "L'accountid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } textResponse += "------------"; } else { textResponse = "Impossible de lister les comptes : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/account/create";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "accountname=" + HttpUtility.UrlEncode("Nouveau Compte C#");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Compte créé :" + Environment.NewLine +  "
"; readerXML.ReadToFollowing("account_id"); textResponse = "L'accountid :" + readerXML.ReadElementContentAsString(); } else { textResponse = "Impossible de lister les comptes : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/account/delete";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "deleteaccountid=" + HttpUtility.UrlEncode("0");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    textResponse = "Compte supprimé!" + Environment.NewLine + Environment.NewLine + "
" + "
"; textResponse = "Voici vos comptes :" + Environment.NewLine + Environment.NewLine + "
" + "
"; while (readerXML.Read()) { if (readerXML.IsStartElement()) { if (readerXML.Name == "account") { textResponse += "------------" + Environment.NewLine + "
"; } else if (readerXML.Name == "account_id") { textResponse += "L'accountid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } textResponse += "------------"; } else { textResponse = "Impossible de lister les comptes : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
							using System.Collections.Generic;
							using System.Linq;
							using System.Web;
							using System.Web.Mvc;
							using System.Web.Routing;
							using System.Web.Security;
							using System.Net;
							using System.IO;
							using System.Xml;
							using System.Text;
							
							
							string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
				            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
				            string ENVOYER_SMS_PRO_LOGIN = "";
				            string ENVOYER_SMS_PRO_PASSWORD = "";
				            string ENVOYER_SMS_PRO_URL = "/api/account/transfer";

				            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
				
				            request.ContentType = "application/x-www-form-urlencoded";
				
				            request.Method = "POST";
				
				            string postData = "debitaccountid=" + HttpUtility.UrlEncode("0") + "&creditaccountid=" + HttpUtility.UrlEncode("0") + "&sms=" + HttpUtility.UrlEncode("1");
				            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
				
				            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
				
				            request.Credentials = myCred;
				
				            Stream dataStream = request.GetRequestStream();
				
				            dataStream.Write(byteArray, 0, byteArray.Length);
				            // Close the Stream object.
				            dataStream.Close();
				
				            WebResponse response = request.GetResponse();
				
				            dataStream = response.GetResponseStream();
				
				            StreamReader reader = new StreamReader(dataStream);
				            // Read the content.
				            string responseFromServer = reader.ReadToEnd();
				            // Clean up the streams.
				            reader.Close();
				            dataStream.Close();
				            response.Close();
				
				            String textResponse = "";
				
				            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
				            {
				                readerXML.ReadToFollowing("status");
				                if (readerXML.ReadElementContentAsString() == "success")
				                {
				                    textResponse = "SMS transférés!" + Environment.NewLine + Environment.NewLine + "
" + "
"; while (readerXML.Read()) { if (readerXML.IsStartElement()) { if(readerXML.Name == "debitaccount") { textResponse += "------COMPTE DEBITE------" + Environment.NewLine + "
"; readerXML.Read(); textResponse += "L'accountid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant : " + readerXML.ReadElementContentAsString() + Environment.NewLine + Environment.NewLine + "
" + "
"; } else if (readerXML.Name == "creditaccount") { textResponse += "------COMPTE CREDITE------" + Environment.NewLine + "
"; readerXML.Read(); textResponse += "L'accountid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "SMS restant : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } else { textResponse = "Impossible de lister les comptes : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";
					            string ENVOYER_SMS_PRO_URL = "/api/stopsms/activate";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "phonenumber=" + HttpUtility.UrlEncode("33600000000");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    readerXML.ReadToFollowing("phone_number");
					                    textResponse = "Le " + readerXML.ReadElementContentAsString() + " est désormais en STOP SMS";
					                }
					                else
					                {
					                    textResponse = "Impossible d'activer le STOP SMS : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;
				      			using System;
								using System.Collections.Generic;
								using System.Linq;
								using System.Web;
								using System.Web.Mvc;
								using System.Web.Routing;
								using System.Web.Security;
								using System.Net;
								using System.IO;
								using System.Xml;
								using System.Text;
								
								
								string ENVOYER_SMS_PRO_HOST = "www.envoyersmspro.com";
					            string ENVOYER_SMS_PRO_PROTOCOL = "https://";
					            string ENVOYER_SMS_PRO_LOGIN = "";
					            string ENVOYER_SMS_PRO_PASSWORD = "";string ENVOYER_SMS_PRO_URL = "/api/stopsms/deactivate";

					            WebRequest request = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL);
					
					            request.ContentType = "application/x-www-form-urlencoded";
					
					            request.Method = "POST";
					
					            string postData = "phonenumber=" + HttpUtility.UrlEncode("33600000000");
					            byte[] byteArray = Encoding.UTF8.GetBytes(postData);
					
					            NetworkCredential myCred = new NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "");
					
					            request.Credentials = myCred;
					
					            Stream dataStream = request.GetRequestStream();
					
					            dataStream.Write(byteArray, 0, byteArray.Length);
					            // Close the Stream object.
					            dataStream.Close();
					
					            WebResponse response = request.GetResponse();
					
					            dataStream = response.GetResponseStream();
					
					            StreamReader reader = new StreamReader(dataStream);
					            // Read the content.
					            string responseFromServer = reader.ReadToEnd();
					            // Clean up the streams.
					            reader.Close();
					            dataStream.Close();
					            response.Close();
					
					            String textResponse = "";
					
					            using (XmlReader readerXML = XmlReader.Create(new StringReader(responseFromServer)))
					            {
					                readerXML.ReadToFollowing("status");
					                if (readerXML.ReadElementContentAsString() == "success")
					                {
					                    readerXML.ReadToFollowing("phone_number");
					                    textResponse = "Le " + readerXML.ReadElementContentAsString() + " n'est plus en STOP SMS";
					                }
					                else
					                {
					                    textResponse = "Impossible de désactiver le STOP SMS : " + Environment.NewLine + "
"; while (readerXML.Read()) { //Check for start elements. if (readerXML.IsStartElement()) { if (readerXML.Name == "request") { textResponse += "La requête : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'errorid : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; textResponse += "L'error message : " + readerXML.ReadElementContentAsString() + Environment.NewLine + "
"; } } } } } ViewBag.Message = textResponse;

Nos autres langages de programmation

Vos packs SMS

section


Envoi de sms groupé
ou à l'unité


  • Sans engagement
  • Sans date limite d'utilisation
  • Sans frais supplémentaires
  • Des prix dégressifs


500 SMS

7,4 cts/unité
37 € HT
Achetez

1000 SMS

7 cts/unité
70 € HT
Achetez

5 000 SMS

6,7 cts/unité
335 € HT
Achetez

10 000 SMS

6,5 cts/unité
650 € HT
Achetez

50 000 SMS

6,2 cts/unité
3 100 € HT
Achetez

100 000 SMS

6 cts/unité
6 000 € HT
Achetez


A la carte

SMS = - € HT soit -cts/unité