Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Luciano is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    22

    VoipCheap

    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.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    You are defining two separate objects here:
    Code:
    Dim XMLHttpRequest As XMLHTTP
    
    Set XMLHttpRequest = New MSXML2.XMLHTTP
    It should be either:
    Code:
    Dim XMLHttpRequest As XMLHTTP
    
    '-- not needed
    'Set XMLHttpRequest = New MSXML2.XMLHTTP
    ...or:
    Code:
    Dim XMLHttpRequest As Object
    
    Set XMLHttpRequest = New MSXML2.XMLHTTP
    And don't forget: when you Set something then Set it to Nothing when you are done.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Does VoipCheap's API support multiple numbers/texts? How do they say you need to format this in the XML element? You are providing it as a list and including a Carriage Return and a Line Feed.

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    I saw this from their web site
    Sending text messages (SMS) via VoipCheap

    You may use special characters; however the use of special characters '(characters like ç, @, €, etc.) may result in longer messages. To check how many messages would be needed to send your message, please use the SMS function in your myaccount, your desktop client or MobileVOIP client.


    Using the VoipCheap client:

    Select the SMS-tab in the application:
    Your user name is already filled out in the Caller ID field. You can opt to show your mobile phone number as well. Just make sure your mobile number is entered in your personal profile and verified (to counter misuse of the SMS).
    You can enter multiple recipients. Simply select them from your phone book or enter them directly in the text field (comma separated, use the full international number)


  5. #5
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    Hmm...looks like a comma is in order.

  6. #6
    Luciano is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    22
    Comma doesn' work neither ';';

  7. #7
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    You've displayed a semi-colon ";". A comma is ",".

  8. #8
    Luciano is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    22
    I know, I mean neither comma "," neither semi-colon ";" is working

  9. #9
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    So you changed this:
    strMobile2 = "00 32 474 68 59 65" & vbCrLf & "00 32 478 27 08 91"
    ...to:
    strMobile2 = "00 32 474 68 59 65,00 32 478 27 08 91"
    ...right?


  10. #10
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Luciano,

    Have you read the info at the VoipCheap website? I did not see an example of any interface for programmers, but I did not download nor look in detail. You could also try to contact the company.

    This is basic for windows computer
    Good luck.

  11. #11
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    if the first one *is working* and the second one isn't is working try:

    Code:
    Private Sub cmdSMS2_Click()
    Dim strMobile2 As String, strSMSText As String
    strSMSText = "Test2"
    strMobile2 = "00 32 474 68 59 65" 
    Call sendSMS(gstrVoipCheapAccount, gstrVoipCheapPassWord, gstrMyCompanyName, strMobile2, strSMSText)
    strMobile2 = "00 32 478 27 08 91"
    Call sendSMS(gstrVoipCheapAccount, gstrVoipCheapPassWord, gstrMyCompanyName, strMobile2, strSMSText)
    End Sub
    edit: bad wording

  12. #12
    Luciano is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    22
    It's rather :
    strMobile1
    = "00 32 474 68 59 65"

    strMobile2 = "00 32 474 68 59 65" & "," & "00 32 478 27 08 91"

  13. #13
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,441
    Did you try what I suggested, two different sends rather than trying to do it together? If the single send works sending two individually should work as well.

  14. #14
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,917
    There is *no* difference between:
    strMobile2 = "00 32 474 68 59 65" & "," & "00 32 478 27 08 91"
    ...and...
    strMobile2 = "00 32 474 68 59 65,00 32 478 27 08 91"

  15. #15
    Luciano is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2011
    Location
    Belgium
    Posts
    22
    yes I did and it's working fine but rather slow. I thought maybe selecting more numbers it should be work faster?

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums