send_gmail: Send an email

Description Usage Arguments Details Value See Also Examples

View source: R/send_gmail.R

Description

Send an email, using google mail info from a private file

Usage

1
2
send_gmail(subject = "", body = "", to=NULL, body_sep = "\\n",
  file_private = ".gmail_private", dir_private = NULL)

Arguments

subject

Character string with subject for the email (Can't include single-quotes.)

body

Character string or vector of character strings, with the body of the email; if it's a vector, it's combined with collapse=body_sep (default = "\n"). (Contents can't include single-quotes, and you need to double-backslashed the backslashes.)

to

Character string with email address of recipient; if NULL, send to self (taken from private info)

body_sep

Character string for combining elements in the input body.

file_private

Character string with file name containing the private information.

dir_private

The directory containing file. If NULL, we use the user's home directory "~". Use "" if the file argument includes the directory.

Details

Uses gmail address and password information in the ~/.gmail_private file (or another file, specified with dir_private and file_private. This should contain records gmail, password, and text, and (optionally) to.

Email will be sent from the address defined in the private file as gmail. If to is defined in that file, it is used as the default "to" email address; otherwise, gmail is used as both the "from" and the "to" addresses. You can specify a different recipient with the 'to' argument to the function.

Value

Returns value from gmail.

See Also

send_text

Examples

1
2
3
4
5
## Not run: 
send_gmail("R message", "R process done")
send_gmail("R message", "R process done", to="someone@somewhere.com")

## End(Not run)

kbroman/mygmailR documentation built on Oct. 22, 2019, 11:17 a.m.