Skip to content

Instantly share code, notes, and snippets.

@dancourse
Created April 7, 2017 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancourse/9effd9a0697eb9ed98d20c0db4d1637d to your computer and use it in GitHub Desktop.
Save dancourse/9effd9a0697eb9ed98d20c0db4d1637d to your computer and use it in GitHub Desktop.
notify_orderConfirmSend
Option Explicit
Sub notify_orderConfirmSend()
Const sUrl As String = "http://tomra.lnx.warwick.ac.uk/api/send/order-confirm"
 
Dim oRequest As WinHttp.WinHttpRequest
Dim sResult As String
 
On Error GoTo Err_notify_orderConfirmSend
 
Set oRequest = New WinHttp.WinHttpRequest
With oRequest
.Open "POST", sUrl, True
.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
.Send "?&strTo=beer_customer@warwick.ac.uk&strSubject=TEST&Strbody=TEST"
.WaitForResponse
sResult = .ResponseText
Debug.Print sResult
sResult = oRequest.Status
Debug.Print sResult
End With
 
 
Exit_notify_orderConfirmSend:
On Error Resume Next
Set oRequest = Nothing
Exit Sub
Err_notify_orderConfirmSend:
MsgBox Err.Description, vbExclamation, Err.Number
Resume Exit_notify_orderConfirmSend
 
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment