I'm running rstudio server in a docker container, hadleyverse, running on top of Ubuntu I would like to be able to send an email from there. I tried following this tutorial and wrote this code:
#Load library
library(sendmailR)
#Set mail options (i.e., port number)
sendmail_options(smtpPort=25)
#Send notification and results
sendmail(from="R notification",
to="MY@EMAIL.COM",
msg="test",
subject="R script has finished")
But I get the following error
Error in socketConnection(host = server, port = port, blocking = TRUE) :
cannot open the connection
In addition: Warning message:
In socketConnection(host = server, port = port, blocking = TRUE) :
localhost:25 cannot be opened
Thanks for the help!