Skip to content

Instantly share code, notes, and snippets.

@spy86
Created February 8, 2019 09:35
Show Gist options
  • Select an option

  • Save spy86/afc6c5f3a684d4775c892e4e57731ca6 to your computer and use it in GitHub Desktop.

Select an option

Save spy86/afc6c5f3a684d4775c892e4e57731ca6 to your computer and use it in GitHub Desktop.
Const MSG_RECIPIENT_LIST = "some-email@gmail.com"
Const MSG_SUBJECT = "Some Subject"
Const MSG_BODY = "Testing"
Dim olkApp, olkSes, olkMsg
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
olkSes.Logon olkApp.DefaultProfileName
Set olkMsg = olkApp.CreateItem(0)
With olkMsg
.To = MSG_RECIPIENT_LIST
.Subject = MSG_SUBJECT
.HTMLBody = MSG_BODY
.Send
End With
olkSes.Logoff
Set olkMsg = Nothing
Set olkSes = Nothing
Set olkApp = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment