SMS

SMS

VBA

VBA sample code to use Reson8 SMS API

Send an SMS message using Reson8 with VBA

Public Function SendSMS(ByVal api_url As String, ByVal username As String, ByVal password As String, ByVal msg_body As String, ByVal msg_encoding As String, ByVal country_code As String, ByVal area_code As String, ByVal recipients As String, ByVal msg_header As String) As String
Dim http As Object

Set http = CreateObject("winhttp.winhttprequest.5.1")
http.Open "POST", api_url, False
http.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.Send "SenderName=" & username & "&Password=" & password & "&MessageBody=" & msg_body & "&Encoding=" & msg_encoding & "&CountryCode=" & country_code & "&AreaCode=" & area_code & "&MessageRecipients=" & recipients & "&MsgHeader=" & msg_header & "&MCC=&MNC="

SendSMS = http.ResponseText

Set http = Nothing
End Function