Skip to contents

This function lets the user send Emails with Attachments using MailGun's API service.

Usage

mail_send(
  from = "RMail <laresbernardo@gmail.com>",
  to = "laresbernardo@gmail.com",
  cc = NULL,
  bcc = NULL,
  subject = "Mail from R",
  text = " \n",
  html = NULL,
  attachment = NULL,
  service = "mailgun",
  creds = NULL,
  quiet = FALSE,
  ...
)

Arguments

from, to, cc, bcc

Character. Emails

subject

Character. Subject for the email.

text, html

Character. Text or HTML to send in the body.

attachment

Character, plot or data.frame. Will send the file, plot as PNG or data.frame as CSV, respectively.

service

Character. Service platform to search on creds.

creds

Character. Credential's user (see get_creds()). Must contain: url (POST address), api (API key).

quiet

Boolean. Keep quite or display messages?

...

Additional parameters.

Value

No return value, called for side effects.

Examples

if (FALSE) { # \dontrun{
myPlot <- noPlot("My plot")
mail_send(
  from = "BLV <myuser@mail.com>",
  to = "youruser@mail.com",
  cc = "myuser@mail.com",
  subject = paste("Daily report:", Sys.Date()),
  attachment = myPlot
)
} # }