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

				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/message/send"

					            Dim strPost As String
						        ' Build POST String
						        strPost = "text=" + System.Web.HttpUtility.UrlEncode("Nouveau message via l'API d'Envoyer SMS Pro depuis un script VB .NET") + "&recipients=" + System.Web.HttpUtility.UrlEncode("33600000000") + "&sendername=" + System.Web.HttpUtility.UrlEncode("SOCIETE")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    readerXML.ReadToFollowing("message_id")
						                    textResponse = "Le messageid : " + readerXML.ReadElementContentAsString()
						                Else
						                    textResponse = "Impossible d'envoyer le message"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/message/stats"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "messageid=" + System.Web.HttpUtility.UrlEncode("0")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    textResponse = "Voici les statistiques de votre message : " + ControlChars.NewLine + ControlChars.NewLine
						
						                    Dim currentNumber As String
						                    Dim currentDate As String
						                    Dim currentStatus As String
						
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "number_status_1" Then
						                                textResponse += readerXML.ReadElementContentAsString() + " SMS ont été délivrés" + ControlChars.NewLine
						                                textResponse += readerXML.ReadElementContentAsString() + " SMS n'ont pas pu être délivrés" + ControlChars.NewLine
						                                textResponse += readerXML.ReadElementContentAsString() + " SMS sont en attente chez l'opérateur" + ControlChars.NewLine
						                                textResponse += readerXML.ReadElementContentAsString() + " SMS sont en cours de traitement" + ControlChars.NewLine
						                                textResponse += readerXML.ReadElementContentAsString() + " numéros sont en STOP SMS" + ControlChars.NewLine
						                            ElseIf readerXML.Name = "mobile_number" Then
						                                currentNumber = readerXML.ReadElementContentAsString
						                                currentDate = readerXML.ReadElementContentAsString
						                                currentStatus = readerXML.ReadElementContentAsString
						
						                                Select Case currentStatus
						                                    Case "1"
						                                        textResponse += ControlChars.NewLine + "Le " + currentNumber + " a reçu le SMS à " + currentDate
						                                    Case "2"
						                                        textResponse += ControlChars.NewLine + "Le " + currentNumber + " n'a pas reçu le SMS"
						                                    Case "3"
						                                        textResponse += ControlChars.NewLine + "Le " + currentNumber + " est en attente chez l'opérateur"
						                                    Case "4"
						                                        textResponse += ControlChars.NewLine + "Le " + currentNumber + " est en cours de traitement"
						                                    Case "5"
						                                        textResponse += ControlChars.NewLine + "Le " + currentNumber + " est en STOP SMS"
						                                End Select
						                            End If
						                        End If
						                    End While
						
						                Else
						                    textResponse = "Impossible d'envoyer le message"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/message/cancel"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "messageid=" + System.Web.HttpUtility.UrlEncode("759576")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    textResponse = "Envoi annulé!"
						                    readerXML.ReadToFollowing("message_id")
						                    textResponse += "Le messageid : " + readerXML.ReadElementContentAsString()
						                    textResponse += "SMS recrédité : " + readerXML.ReadElementContentAsString()
						                    textResponse += "SMS restant : " + readerXML.ReadElementContentAsString()
						                Else
						                    textResponse = "Impossible d'envoyer le message"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/account/getallaccounts"
						        
						        Dim strPost As String =""
						        
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    textResponse = "Voici vos comptes :" + ControlChars.NewLine + ControlChars.NewLine
						
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						
						                            ' See if perls element or article element.
						                            If readerXML.Name = "account" Then
						                                textResponse += "------------" + ControlChars.NewLine
						                            ElseIf readerXML.Name = "account_id" Then
						                                textResponse += "L'accountid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "SMS restant : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                    textResponse += "------------"
						                Else
						                    textResponse = "Impossible de lister les comptes"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/account/create"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "accountname=" + System.Web.HttpUtility.UrlEncode("Nouveau Compte VB .NET")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						
						                    readerXML.ReadToFollowing("account_id")
						                    textResponse = "Compte créé!" + ControlChars.NewLine + "L'accountid : " + readerXML.ReadElementContentAsString()
						                Else
						                    textResponse = "Impossible de créer le compte"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
					            Const ENVOYER_SMS_PRO_URL As String = "/api/account/delete"
					            
					            Dim strPost As String
						        ' Build POST String
						        strPost = "deleteaccountid=" + System.Web.HttpUtility.UrlEncode("6753")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						
						                    textResponse = "Compte supprimé!" + ControlChars.NewLine + "Voici vos comptes :" + ControlChars.NewLine + ControlChars.NewLine
						
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						
						                            ' See if perls element or article element.
						                            If readerXML.Name = "account" Then
						                                textResponse += "------------" + ControlChars.NewLine
						                            ElseIf readerXML.Name = "account_id" Then
						                                textResponse += "L'accountid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "SMS restant : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                    textResponse += "------------"
						                Else
						                    textResponse = "Impossible de supprimer le compte"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/account/transfer"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "debitaccountid=" + System.Web.HttpUtility.UrlEncode("0") + "&creditaccountid=" + System.Web.HttpUtility.UrlEncode("0") + "&sms=" + System.Web.HttpUtility.UrlEncode("1")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						
						            Dim textResponse As String
						
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						
						                    textResponse = "SMS transférés!" + ControlChars.NewLine + ControlChars.NewLine
						
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						
						                            ' See if perls element or article element.
						                            If readerXML.Name = "debitaccount" Then
						                                textResponse += "------COMPTE DEBITE------" + ControlChars.NewLine
						                                readerXML.Read()
						                                textResponse += "L'accountid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "SMS restant : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            ElseIf readerXML.Name = "creditaccount" Then
						                                textResponse += "------COMPTE CREDITE------" + ControlChars.NewLine
						                                readerXML.Read()
						                                textResponse += "L'accountid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "Le nom du compte : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "SMS restant : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                Else
						                    textResponse = "Problème lors du transfert de SMS"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            Console.WriteLine(textResponse)
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/stopsms/activate"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "phonenumber=" + System.Web.HttpUtility.UrlEncode("33600000000")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    readerXML.ReadToFollowing("phone_number")
						                    textResponse = "Le " + readerXML.ReadElementContentAsString() + " est désormais en STOP SMS."
						                Else
						                    textResponse = "Impossible d'activer le STOP SMS"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			
				      			Imports System.Diagnostics.CodeAnalysis
								Imports System.Security.Principal
								Imports System.Web.Routing
								Imports System.Net
								Imports System.IO
								Imports System.Xml
								
								
								Const ENVOYER_SMS_PRO_HOST As String = "www.envoyersmspro.com"
						        Const ENVOYER_SMS_PRO_PROTOCOL As String = "https://"
						        Const ENVOYER_SMS_PRO_LOGIN As String = ""
						        Const ENVOYER_SMS_PRO_PASSWORD As String = ""
						        Const ENVOYER_SMS_PRO_URL As String = "/api/stopsms/deactivate"
						        
						        Dim strPost As String
						        ' Build POST String
						        strPost = "phonenumber=" + System.Web.HttpUtility.UrlEncode("33600000000")
						
						        ' Create POST
						        Dim request As WebRequest = WebRequest.Create(ENVOYER_SMS_PRO_PROTOCOL + ENVOYER_SMS_PRO_HOST + ENVOYER_SMS_PRO_URL)
						        request.Method = "POST"
						        Dim byteArray As Byte() = Encoding.UTF8.GetBytes(strPost)
						
						        Dim myCred As New NetworkCredential(ENVOYER_SMS_PRO_LOGIN, ENVOYER_SMS_PRO_PASSWORD, "")
						
						        request.ContentType = "application/x-www-form-urlencoded"
						        request.Credentials = myCred
						        request.ContentLength = byteArray.Length
						        Dim dataStream As Stream = request.GetRequestStream()
						        dataStream.Write(byteArray, 0, byteArray.Length)
						        dataStream.Close()
						        ' Get the response.
						        Dim response As WebResponse = request.GetResponse()
						        dataStream = response.GetResponseStream()
						        Dim reader As New StreamReader(dataStream)
						        Dim responseFromServer As String = reader.ReadToEnd()
						        ' Clean upthe streams.
						        reader.Close()
						        dataStream.Close()
						        response.Close()
						        ' Return result to calling function
						        If responseFromServer.Length > 0 Then
						            Dim textResponse As String
						            ' Create an XmlReader
						            Using readerXML As XmlReader = XmlReader.Create(New StringReader(responseFromServer))
						                readerXML.ReadToFollowing("status")
						                If readerXML.ReadElementContentAsString() = "success" Then
						                    readerXML.ReadToFollowing("phone_number")
						                    textResponse = "Le " + readerXML.ReadElementContentAsString() + " n'est plus en STOP SMS."
						                Else
						                    textResponse = "Impossible de désactiver le STOP SMS"
						                    While readerXML.Read()
						                        ' Check for start elements.
						                        If readerXML.IsStartElement() Then
						                            ' See if perls element or article element.
						                            If readerXML.Name = "request" Then
						                                textResponse += "La requête : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'errorid : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                                textResponse += "L'error message : " + readerXML.ReadElementContentAsString + ControlChars.NewLine
						                            End If
						                        End If
						                    End While
						                End If
						            End Using
						            ViewData("Message") = textResponse
						        Else
						            ViewData("Message") = CType(response, HttpWebResponse).StatusDescription
						        End If				      			

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é