12

NOOB question related to R blastula. I am trying to send an email with blastula using office365. I was able to create a credentials file but can't seem to send a simple test email:

require(blastula) ; require(curl)
email <- compose_email(body = "Insert your e-mail body here",  footer = "Insert your e-mail footer here")
email %>% smtp_send(from = "me@email.com", to = "someone_else@email.com", credentials = creds_file("C:/Users/me/CREDS_FILE")
)

There seems be a dependency on curl that's throwing the error: Error in curl::curl_fetch_memory(url, handle = h) : MAIL failed: 530

What am I doing wrong ?

user2948714
  • 671
  • 2
  • 9
  • 13

2 Answers2

2

Try use_ssl = TRUE in create_smtp_creds_key. This worked for me.

email <- compose_email(
body = md(
  "Your email message"
))
smtp <- create_smtp_creds_key(
  id = "outlook",
  user = "youremail@outlook.com",
  provider = "office365",
  host = "smtp.office365.com",
  use_ssl = TRUE)
 email %>%
smtp_send(to = to,
          from = from,
          subject = subject,
          credentials = creds_key(id = "outlook"))
pbertens
  • 49
  • 4
0

After doing some searching around I found this question and answer which seemed related. Hadley's suggestion of restarting R and reinstalling {curl} fixed the issue that I was having.

I actually reinstalled both {curl} and {blastula} with

install.packages(c('blastula', 'curl'))
Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
jkgrain
  • 769
  • 5
  • 20