create_draft: Connect to Outlook and create an e-mail message.

Description Usage Arguments Value Examples

View source: R/create_draft.R

Description

Connect to Outlook and create an e-mail message.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
create_draft(
  ol_app,
  addr_from = NULL,
  addr_to = NULL,
  addr_cc = NULL,
  subject = NULL,
  body_html = NULL,
  body_plain = NULL,
  attachments = NULL,
  use_signature = TRUE,
  show_message = TRUE
)

Arguments

ol_app

An object that represents an Outlook application instance (class: class 'COMIDispatch.')

addr_from

optional fields to fill

addr_to

optional fields to fill

addr_cc

optional fields to fill

subject

optional fields to fill

attachments

path to file(s) to attach

use_signature

if TRUE, get the HTML signature from the new blank message, than put it back *after the plain text* after the message is created.

show_message

if TRUE, show the message for editing after creation

html_body

HTML contents of the message. Takes precedence over body

body

plain text contents of the message

Value

a COM object that binds to an e-mail window (''Outlook.MailItem'“)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

com <- connect_outlook()
msg <- create_draft(com, addr_to = "foo@bar.com")

# Attachments
msg <- create_draft(con, attachments = c('foo.txt', 'foo2.txt'))


## End(Not run)

lgaborini/outlookMailer documentation built on Jan. 17, 2020, 10:40 a.m.