I know that this is possible with python. However, I want to know if there is a way to do this with R as well. Code snippets will be appreciated.
Asked
Active
Viewed 101 times
1 Answers
1
There are diverse ways, see this overview for example. SMTP settings for Outlook and Office365 can be found here.
Fill your credentials in the following snippet and it should work straight away:
install.packages("remotes")
library(remotes)
remotes::install_github("datawookie/emayili")
install.packages("magrittr")
library(magrittr)
library(dplyr)
library(emayili)
msg <- envelope() %>%
from("you@email.net") %>%
to("me@outlook.com") %>%
subject("Test email subject") %>%
attachment("./yourFile.txt") %>%
text("Test email body")
smtp <- server(host = "smtp.office365.com",
port = 587,
username = "username",
password = "password")
smtp(msg, verbose = TRUE)

Francois Vanderseypen
- 1,432
- 1
- 12
- 22
-
Can you please mark it as answered so others can benefit. – Francois Vanderseypen Mar 19 '20 at 07:27