Results 1 to 4 of 4
  1. #1
    gebron08 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    2

    Post Sending SMS via Access 2010

    Hi guys, does anyone have an idea how can i do this or explain the process how can i achieve this..



    Thanks

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I use third party hosts such as Clickatell. I think the VBA I use depends on the XMLHTTP library. Third party services will offer API's to provide an interface to their servers.

  3. #3
    gebron08 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    2
    thanks for the info.. would you mind sharing your code as my reference.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Vendors that offer API's will usually offer code snippets in various languages. If you choose an XML over http interface you will need to make a reference to a version of Microsoft XML(XX), not positive what the reference name looks like but there are typically only a couple options available. I usually grab the latest version.

    I took a quick look at clickatell's website and did not see any sample snippets. Here is one for a basic text message. I cannot remember if it is the SMS protocol but I believe it is. I got this from a text file within one of my project's folders (as a snippet). The string that you POST and the HEADER will be specific to your vendor's API.

    Code:
    If IsNothing(Me.txtMsg.Value) Then 'Custom UDF
    MsgBox "Please type your message in the space provided", vbInformation, "Need Msg"
    Exit Sub
    End If
    
    If IsNothing(Me.txtNumber.Value) Then 'Custom UDF
    MsgBox "Please enter the phone number or select one from the list.", vbInformation, "No Number"
    Exit Sub
    End If
    
    Dim strMsg As String
    Dim strNumber As String
    strMsg = Me.txtMsg.Value
    strNumber = Me.txtNumber.Value
    
    Dim sUrl
    Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText
    Dim oXMLHTTP As Object
    Dim sPostData, sResult
    sUrl = "https://some.address.here"
    sAPI_ID = "XXX"
    sPassword = "XXX"
    sUsername = "XXX"
    sMobileNo = "1" & strNumber 'International code and number
    sText = strMsg
    
    sPostData = "api_id=" & sAPI_ID
    sPostData = sPostData & "&user=" & sUsername
    sPostData = sPostData & "&password=" & sPassword
    sPostData = sPostData & "&to=" & sMobileNo
    sPostData = sPostData & "&text=" & sText
    
    Set oXMLHTTP = CreateObject("Microsoft.XMLHTTP")
    
    oXMLHTTP.Open "POST", sUrl, False
    oXMLHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    oXMLHTTP.Send sPostData
    
    sResult = oXMLHTTP.ResponseText
    
    Set oXMLHTTP = Nothing
    
    'Response.Write sResult
    If fWrite_Text_Confirmation(sResult) Then 'Custom UDF
    MsgBox "Your message has been sent."
    End If

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Combining 'sending mail' with 'sending a report'.
    By Mattbro in forum Programming
    Replies: 2
    Last Post: 11-25-2012, 07:42 AM
  2. Replies: 1
    Last Post: 11-14-2012, 01:43 PM
  3. sending email through Access
    By crowegreg in forum Import/Export Data
    Replies: 4
    Last Post: 04-15-2012, 03:49 PM
  4. Replies: 1
    Last Post: 05-10-2011, 09:48 AM
  5. sending texts from my pc with Access
    By bwian1234 in forum Access
    Replies: 1
    Last Post: 08-26-2010, 05:43 AM

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