Arturo Sbr
Arturo Sbr

Reputation: 6323

What `control` settings are valid to send automated emails from Outlook using `sendmailR`?

EDIT: I found a solution. You can find it here. I had to resort to using mailR. I could never get sendmailR to work with the Office 365 services.

I am trying to send a single email using library(sendmailR) to later send daily automated emails to about 500 people. Unfortunately, I'm suck in step 1.

It is vital that I send these emails from my institution's Outlook account. I have no idea what control settings to use in order to successfully send mails from Outlook. I checked a couple of questions but they are either using the gmail SMPT server or they do not specify the control = ... settings they used. For example:

Use sendmailR with Windows

Sending an email from R

This is what I'm working with:

from <- "<[email protected]>"
to <- "<[email protected]>"
subject <- "Hello from R"
body <- list("It's working.")

sendmail(from, to, subject, body,
         control = list(smptServer = "oultook.office.365", port = 443))

And I'm getting the following error message:

Error in wait_for(code) : 
SMTP Error: 5.7.57 SMTP; Client was not authenticated to send anonymous mail 
during MAIL FROM [SN4PR0501CA0061.namprd05.prod.outlook.com]

I believe I'm not specifying the port correctly. The sendmaiLR documentation is not specific enough, but something tells me I should be writing the port as "port 443"or something along those lines.

Does anyone know what controlsettings I should be using?

Upvotes: 1

Views: 202

Answers (0)

Related Questions