The goal of IMmailgun is to make sending emails from R easy. To use it, you will need a mailgun account.
This is a basic example which shows you how to solve a common problem:
library(IMmailgun)
email_client <- mailgun$new(url = url, api_key = api_key, from = from)
email_client$sendEmail(to = c("ignacio82@gmail.com", "ignacio@protonmail.com"),
subject = "Test", plaintext = "Hola a todos!")
#> [[1]]
#> Response [https://api.mailgun.net/v3/email.ignacio.website/messages]
#> Date: 2017-11-18 13:59
#> Status: 200
#> Content-Type: application/json
#> Size: 109 B
#> {
#> "id": "<20171118135928.5521.00B9D6D04BDF91A9@email.ignacio.website>",
#> "message": "Queued. Thank you."
#>
#> [[2]]
#> Response [https://api.mailgun.net/v3/email.ignacio.website/messages]
#> Date: 2017-11-18 13:59
#> Status: 200
#> Content-Type: application/json
#> Size: 110 B
#> {
#> "id": "<20171118135929.35553.18C6B386247556F5@email.ignacio.website>",
#> "message": "Queued. Thank you."
email_client$sendEmail(to = "ignacio82@gmail.com",
subject = "Test with attachment",
plaintext = "Check the attachment",
attachment = './README.md')
#> [[1]]
#> Response [https://api.mailgun.net/v3/email.ignacio.website/messages]
#> Date: 2017-11-18 13:59
#> Status: 200
#> Content-Type: application/json
#> Size: 109 B
#> {
#> "id": "<20171118135929.6327.029AF950E7C2B85C@email.ignacio.website>",
#> "message": "Queued. Thank you."