These helper functions, the credential helpers, are used to supply SMTP
configuration and authorization information for the smtp_send()
function.
The creds_file()
, creds_anonymous()
, creds_key()
, and creds()
functions are to be used expressly with the credentials
argument of
smtp_send()
.
creds(user = NULL, provider = NULL, host = NULL, port = NULL, use_ssl = TRUE) creds_anonymous(provider = NULL, host = NULL, port = NULL, use_ssl = TRUE) creds_envvar( user = NULL, pass_envvar = "SMTP_PASSWORD", provider = NULL, host = NULL, port = NULL, use_ssl = TRUE ) creds_key(id) creds_file(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 | Configuration info for the SMTP server. The |
pass_envvar | The name of the environment variable that holds the value
for an email account password. This is only used in the |
id | When using the |
file | When using the |
A credentials list object.
The creds()
credential helper allows for manual specification of SMTP
configuration and authentication.
The creds_anonymous()
credential helper is similar to creds()
but
provides convenient defaults for authenticating anonymously with an SMTP
server.
The creds_key()
credential helper gets credentials stored in the
system-wide key-value store. We can set that key and the credentials data
using the create_smtp_creds_key()
function.
The creds_file()
credential helper is used to obtain credentials from a
file stored on disk. We can create that file using the
create_smtp_creds_file()
function.
The creds_envvar()
credential helper reads the password from the
SMTP_PASSWORD
environment variable (or an environment variable name that
you specify). If using environment variables for other parameters, call
Sys.getenv()
manually (e.g. user = Sys.getenv("SMTP_USER")
).