0

When I try to use sendmail from the sendmailR package in R, I am getting this error:

Error in .smtp_submit_mail(server, port, headers, msg, verbose) : argument "msg" is missing, with no default

Here is the code I am trying to execute:

library(sendmailR)
from <- "<some.address@gmail.com>"
to <- "<some.address@gmail.com>"
subject <- "this subject"
body <- "this text right here"
mailControl <- list(smtpServer = "ASPMX.L.GOOGLE.COM")
sendmail(from = from, to = to, subject = subject,
                  body = body, control = mailControl)

This is essentially the same code that can be found in online tutorials.

MrFlick
  • 195,160
  • 17
  • 277
  • 295
ben
  • 787
  • 3
  • 16
  • 32

1 Answers1

1

The parameter for the body of the email is called msg, not body. Use

sendmail(from = from, to = to, subject = subject,
                  msg = body, control = mailControl)
MrFlick
  • 195,160
  • 17
  • 277
  • 295