Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Exemple en VB 4/5/6 d'envoi de SMS unitaire
Private Sub Form_Load()
' Création du XML à poster
Dim xml As String
xml = "<request login=""your-login"" password=""your-password"">" & _
"<push media=""sms"" type=""on_demand"" name=""Test API Sms VB6"">" & _
"<message type=""text"">Mon premier test sms</message>" & _
"<recipients>" & _
"<add target=""+33 600000000"" />" & _
"</recipients>" & _
"</push>" & _
' Construction et envoi de la requête HTTP
Dim postURL As String
postURL = ""
With CreateObject("MSXML2.XMLHTTP")
.open "POST", postURL, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send (xml)
response = .responseText
End With
MsgBox (response)
End Sub
Private Function EncodeBase64(ByRef binary() As Byte) As String
Dim objXML, objNode
Set objXML = CreateObject("Microsoft.XMLDOM")
Set objNode = objXML.createElement("doc")
objNode.dataType = "bin.base64"
objNode.nodeTypedValue = binary
EncodeBase64 = objNode.Text
Set objNode = Nothing
Set objXML = Nothing
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment