Skip to content

Instantly share code, notes, and snippets.

@kthwaite
Last active July 31, 2017 13:03
Show Gist options
  • Save kthwaite/b8e341a9f68ed156caf07ef503ef3cc8 to your computer and use it in GitHub Desktop.
Save kthwaite/b8e341a9f68ed156caf07ef503ef3cc8 to your computer and use it in GitHub Desktop.
Create and send an email in Outlook with Applescript
tell application "Microsoft Outlook"
set theContent to "Mail Content"
-- substitute 'plain text content' for 'content' if you don't want to use HTML
set theMessage to make new outgoing message with properties {subject:"Mail Subject", content:theContent}
make new recipient with properties {email address:{address:"[email protected]"}} at end of to recipients of theMessage
-- recipient type can be 'to recipient', 'cc recipient' or 'bcc recipient'
make new recipient with properties {email address:{address:"[email protected]"}} at end of cc recipients of theMessage
-- optionally open the message instead...
-- open theMessage
send theMessage
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment