Learn R Programming

sendmailR

Package contains a simple SMTP client with minimal dependencies which provides a portable solution for sending email, including file attachments and inline html reports, from within R. SMTP Authentication and SSL/STARTTLS is implemented using curl.

Usage

from <- sprintf("<sendmailR@@\%s>", Sys.info()[4]) 
to <- "<olafm@@datensplitter.net>" 
subject <- "Hello from R" 
body <- list("It works!", mime_part(iris)) 
sendmail(from, to, subject, body, 
  control=list(smtpServer="ASPMX.L.GOOGLE.COM")) 

# With authentication and SSL
sendmail(from="from@example.org", 
  to=c("to1@example.org","to2@example.org"), 
  subject="SMTP auth test", 
  msg=mime_part("This message was send using sendmailR and curl."), 
  engine = "curl", 
  engineopts = list(username = "foo", password = "bar"), 
  control=list(smtpServer="smtp://smtp.gmail.com:587", verbose = TRUE) 
)

Install from github

To install the bleeding edge version from GitHub using devtools:

library("devtools")
install_github("olafmersmann/sendmailR")

Or using pak:

library("pak")
pkg_install("olafmersmann/sendmailR")

Copy Link

Version

Install

install.packages('sendmailR')

Monthly Downloads

6,091

Version

1.4-0

License

GPL-2

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

January 12th, 2023

Functions in sendmailR (1.4-0)

sendmail

Send mail from within R
mime_part.data.frame

Create a MIME part from a data.frame.
mime_part.default

Default MIME part method
sendmail_options

Set package specific options.
mime_part.character

Create an inline character MIME Part
mime_part.ggplot

Creates a MIME part from a ggplot2 plot object
mime_part.trellis

Creates a MIME part from a trellis plot object
mime_part.matrix

Create a MIME part from a matrix.
mime_part_html

Create an inline HTML MIME Part
mime_part

Create a MIME part