I have been setting the emayili package to send email with two attached files from my Outlook account, but so far I have been unable to do it.
The code is as following (with emails and passwords replaced with 'aaa' and 'bbb' for privacy/security):
email <- envelope(
from = "aaa@domain.com",
to = "bbb@domain.com",
subject = subject,
html = body) %>%
attachment('filename1.xlsx') %>%
attachment('filename2.xlsx')
smtp <- server(host = "smtp.mailtrap.io",
port = 587,
username = "********",
password = "*********")
smtp(email, verbose = TRUE)
When I run the code, I get the following result:
> smtp(email, verbose = TRUE)
Sending email to smtp.office365.com:587/.
Error: Request failed after 5 attempts
Run `rlang::last_error()` to see where the error occurred.
In addition: Warning messages:
1: In smtp(email, verbose = TUE) :
restarting interrupted promise evaluation
2: In f(...) : restarting interrupted promise evaluation
3: In f(...) : restarting interrupted promise evaluation
4: In f(...) : restarting interrupted promise evaluation
5: In f(...) : restarting interrupted promise evaluation
Any idea what is going wrong?