Skip to content

Instantly share code, notes, and snippets.

@spy86
Created August 3, 2017 10:09
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 spy86/2dd6f6cb26326f10cbfd0e4d5f1a6ab7 to your computer and use it in GitHub Desktop.
Save spy86/2dd6f6cb26326f10cbfd0e4d5f1a6ab7 to your computer and use it in GitHub Desktop.
Const MSG_RECIPIENT_LIST = "test_123@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
@fadedsun17
Copy link

If I have multiple email accounts synced, how do i get it to select the "From" address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment