create_smtp_creds_file: Store SMTP credentials in a file

Description Usage Arguments Examples

View source: R/create_credentials.R

Description

We can create a file with SMTP configuration and access credentials for the purpose of more easily sending email messages through smtp_send(). With this file produced, the credentials helper creds_file() can be used in the credentials argument of smtp_send().

Usage

1
2
3
4
5
6
7
8
create_smtp_creds_file(
  file,
  user = NULL,
  provider = NULL,
  host = NULL,
  port = NULL,
  use_ssl = NULL
)

Arguments

file

The output filename for the credentials file.

user

The username for the email account. Typically, this is the email address associated with the account.

provider

An optional email provider shortname for autocompleting SMTP configuration details (the host, port, use_ssl options). Options currently include gmail, outlook, and office365. If nothing is provided then values for host, port, and use_ssl are expected.

host, port, use_ssl

Configuration info for the SMTP server. The host and port parameters are the address and port for the SMTP server. use_ssl is an option as to whether to allow the use of STARTTLS, if available: it should be TRUE unless you have a specific reason to set it to FALSE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Create a credentials file to make it
# much easier to send email out through
# Gmail with `smtp_send()`; name the
# file "gmail_creds"

# create_smtp_creds_file(
#   file = "gmail_creds",
#   user = "user_name@gmail.com",
#   provider = "gmail"
#   )

rich-iannone/blastula documentation built on Oct. 17, 2020, 8:59 p.m.