Hi
I'm using a VBA-function (sendSMS) to sent a Text-message with VoipCheap.
something like :
Public Function sendSMS(ByVal sms_username As String, _
ByVal sms_password As String, _
ByVal sms_from As String, _
ByVal sms_to As String, _
ByVal sms_msg As String)
On Error GoTo Err_sendSMS
Dim strResult As String
Dim URL_base As String
Dim str_POST As String
Dim XMLHttpRequest As XMLHTTP
Set XMLHttpRequest = New MSXML2.XMLHTTP
URL_base = "https://www.voipcheap.com/myaccount/sendsms.php?"
str_POST = URL_base & _
"username=" & sms_username & _
"&password=" & sms_password & _
"&from=" & sms_from & _
"&to=" & sms_to & _
"&text=" & sms_msg
Debug.Print str_POST
XMLHttpRequest.Open "GET", str_POST, False
XMLHttpRequest.send
MsgBox XMLHttpRequest.responseText
Exit_sendSMS:
Exit Function
Err_sendSMS:
' MsgBox "sendSMS - " & Err.Description & " " & Err.Number
MsgBox "ErrorsendSMS"
Resume Exit_sendSMS
End Function
I call this function in my vba-Code (cdmSMS1 and cmdSMS2 are command-buttons in a form)
Private Sub cmdSMS1_Click()
Dim strMobile1 As String, strSMSText As String
strSMSText = "Test1"
strMobile1 = "00 32 474 68 59 65"
Call sendSMS(gstrVoipCheapAccount, gstrVoipCheapPassWord, gstrMyCompanyName, strMobile1, strSMSText)
End SubPrivate Sub cmdSMS_Click()
This is working fine (one sms_to number)
Private Sub cmdSMS2_Click()
Dim strMobile2 As String, strSMSText As String
strSMSText = "Test2"
strMobile2 = "00 32 474 68 59 65" & vbCrLf & "00 32 478 27 08 91"
Call sendSMS(gstrVoipCheapAccount, gstrVoipCheapPassWord, gstrMyCompanyName, strMobile2, strSMSText)
End Sub
This is not working, only the first sms_to number is receiving the strSMSText-message.