Blastula email: Timeout was reached: [smtp.office365.com:587]

Hi There,

I'm trying to use Blastula to send emails through my work's outlook.office365 account. I'm getting a "Timeout was reached" when sending the email.

Here is the example setup code:

> create_smtp_creds_file(
+         file = "office365_creds",
+         user = "andre@work.org",
+         provider = "office365",
+         host = "smtp.office365.com",
+         use_ssl = TRUE
+ )
The SMTP credentials file (`office365_creds`) has been generated
> email %>%
+         smtp_send(
+                 to = "andre@gmail.com",
+                 from = "andre@work.org",
+                 subject = "Testing the `smtp_send()` function",
+                 credentials = creds_file("office365_creds")
+         )
Error in curl_fetch_memory(smtp_server, handle = h) : 
  Timeout was reached: [smtp.office365.com:587] Operation timed out after 10001 milliseconds with 0 out of 0 bytes received

I think the issue is related to dual authentication. I had a similar issue when sending email through my personal Gmail account. However, I resolved the problem by creating an "app password" . I see Microsoft provides to option to use app passwords too. Unfortunately, I don't have this option for my work email account.

Any thoughts?

Best,

André

Try the following,
options (timeout =30000)
This will increase your timeout duration (measured in milliseconds).

Hello, @Sivuyile.

Thank you for the suggestion. After changing the timeout, it seems like I'm getting a more accurate error message related to the two-factor authentication.

> email %>%
+   smtp_send(
+     to = "my gmail",
+     from = "my Outlook email",
+     subject = "Testing the `smtp_send()` function",
+     credentials = creds_file("office365_creds")
+   )
Error in curl_fetch_memory(smtp_server, handle = h) : Login denied
1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.