Home

Macros and Programming

 

CardboxForumsMacros and Programming > "Sending SMS from Cardbox macro"

Sending SMS from Cardbox macro

Looking for service provider and sample macro

Current user: [none]
Register / Log In · Help

Posted By Post

stuart

12-Dec-2012 16:31

Does anyone have any ideas on a SMSC and sample macro code to send SMS via Cardbox Macro to a mobile number specified on the record?

There is an old post on here that does exactly this but the carrier/SMSC is no longer providing this service!

Many thanks in advance.

stuartsimms

13-Dec-2012 09:20

Update: I've found something now and written it into a macro, so thought I'd post it here in case anyone else has use for it at any point.

The SMS carrier is www.clickatell.com - SMS cost 3p each and have to buy minimum of a bundle of 400 for £12 - no other setup costs.

-------------------

x = InputBox ("Enter mobile number","Send SMS Message")

If x = "" Then
Halt
End If

y = InputBox ("Enter your message","Send SMS Message")

If y = "" Then
Halt
End If

Dim sUrl
Dim sAPI_ID, sPassword, sUsername, sMobileNo, sText
Dim oXMLHTTP, sPostData, sResult
sUrl = "http://api.clickatell.com/http/sendmsg"
sAPI_ID = "XXXXXXXXX"
sPassword = "XXXXXXXXXXX"
sUsername = "XXXXXXXXXX"
sMobileNo = x
sText = y
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

If InStr (sResult,"ID") Then
MsgBox "Message sent successfully!" & vblf & vblf & sResult
Else
MsgBox "ERROR: Message not sent"
End If

bert

13-Dec-2012 10:39

thxs for sharing this!

Quick Reply

Please log in or register before trying to post a reply.

 
© 2010 Cardbox Software Limited   Home