Create e-mail appender

  layout = layoutEmail,
  label =["nodename"],
  test = FALSE



The layout to be used by the appender.


Arguments to be passed to the sendmail function in the sendmailR package (except subject and msg).


A label to be used in the e-mail subject to identify a run. By default the name of the computer is used.


If TRUE, a message will be displayed on the console instead of sending an e-mail.


Creates an appender that will send log events to an e-mail address using the sendmailR package. Please make sure your settings are correct by using the sendmailR package before using those settings here. ParallelLogger will not display any messages if something goes wrong when sending the e-mail.

Using GMail

To use a GMail account, make sure to enable 2-step verification on your Google account (see 'Security'). Click on 2-Step Verification, and scroll down to 'App passwords'. Here, you can create an app-specific password to be used with ParallelLogger. You can set = "", and be sure to use engine = "curl".


mailSettings <- list(
  from = "",
  to = "",
  engine = "curl",
  engineopts  = list(
    username = "",
    password = "Secret!"
  control = list( = ""
# Setting test to TRUE in this example so we don't really send an e-mail:
appender <- createEmailAppender(
  layout = layoutEmail,
  mailSettings = mailSettings,
  label = "My R session",
  test = TRUE
#> Error: 'sendmailR' must be installed for this functionality.

logger <- createLogger(name = "EMAIL", threshold = "FATAL", appenders = list(appender))
#> Error in createLogger(name = "EMAIL", threshold = "FATAL", appenders = list(appender)): object 'appender' not found
#> Error in is(logger, "Logger"): object 'logger' not found

logFatal("Something bad")

#> Warning: Could not find logger EMAIL
#> [1] FALSE