Trouble setting up Outlook email with n8n SMTP

Hey everyone,

I’m pulling my hair out trying to get my Outlook email working with n8n. I’ve done all the usual stuff:

  • Turned on IMAP and POP in Outlook
  • Set up two-factor auth and made an app password
  • Put in all the SMTP details in n8n (email, app password, port 587, STARTTLS on)

I’ve tried both smtp-mail.outlook.com and smtp.office365.com as the host, but no luck.

Every time I try to connect, I get this error:

535 5.7.139 Authentication unsuccessful, basic authentication is disabled. [FR4P281CA0070.DEUP281.PROD.OUTLOOK.COM 2025-02-17T11:47:55.715Z 08DD4D35366FD225]

Am I missing something obvious here? Is there some secret Outlook setting I need to flip?

Any help would be awesome. Thanks!

ugh, been there done that. outlook’s a pain these days. have u tried using an oauth2 flow instead? its a bit more complex but way more reliable. u gotta set up some stuff in azure first tho. if ur stuck, hit me up and ill try to walk u thru it. good luck mate!

I ran into this same issue recently. Microsoft has indeed tightened security, which is causing these SMTP headaches. While the Graph API suggestion is solid, there’s another approach that might work for you without changing your entire setup.

Try using OAuth 2.0 authentication instead of basic auth. You’ll need to register your app in the Azure portal and obtain the necessary credentials. Then, in n8n, use the ‘Microsoft OAuth2 API’ credentials instead of the standard SMTP setup.

This method maintains SMTP functionality while meeting Microsoft’s new security requirements. It took me some trial and error, but once set up, it’s been working flawlessly. The n8n docs have a guide on OAuth 2.0 setup that I found helpful.

If you go this route and hit any snags, feel free to ask for more details. Good luck!

I’ve been through this exact headache with Outlook and n8n. The error you’re seeing is actually a recent change Microsoft made to enhance security. They’ve disabled basic authentication for most accounts, which is what n8n typically uses.

Here’s what worked for me:

Instead of using SMTP, I switched to using Microsoft Graph API. It’s a bit more involved to set up initially, but it’s way more reliable and secure. You’ll need to register an app in Azure, grant it the necessary permissions, and then use those credentials in n8n.

If you absolutely need to stick with SMTP, you might be able to temporarily re-enable basic auth for your account by contacting Microsoft support. But keep in mind this is just a stopgap solution.

The Graph API route is definitely the way to go for long-term stability. It took me a bit to figure out, but now it works like a charm. Let me know if you need any pointers on setting it up!