Trouble setting up Outlook SMTP in n8n: Authentication fails

I’m stuck trying to get Outlook SMTP working in n8n. I’ve done everything I can think of:

  • Turned on IMAP and POP in Outlook
  • Set up two-step verification and made an app password
  • Put in my SMTP details in n8n:

But I keep getting this error:

Couldn't connect with these settings Invalid login: 535 5.7.139 Authentication unsuccessful, basic authentication is disabled.

What am I missing? Do I need to change something else in my Outlook settings to make this work?

Any help would be great. Thanks!

I’ve encountered this exact problem before, and it can be frustrating. The key issue here is that Microsoft has disabled basic authentication for Outlook accounts. Instead, you need to use OAuth 2.0 for authentication.

To fix this, you’ll need to register your n8n instance as an application in the Azure portal. This process involves creating an app registration, setting up the necessary permissions, and obtaining a client ID and secret.

Once you’ve done that, you can use the OAuth2 node in n8n to handle the authentication flow. It’s a bit more complex than basic auth, but it’s much more secure and reliable.

If you’re not comfortable with setting up OAuth, another option is to use a different email service that still supports basic auth, like Gmail or a custom SMTP server. Just be aware that many providers are moving away from basic auth for security reasons.

Have you considered using Microsoft Graph API instead of SMTP? It’s the recommended approach for integrating with Outlook nowadays. You’ll need to register your app in Azure AD and use OAuth 2.0, but it’s more secure and reliable than SMTP.

If you’re set on using SMTP, make sure your account isn’t using Modern Authentication. Some organizations enforce this, which disables basic auth. You might need to contact your IT department if that’s the case.

As a workaround, you could try using a third-party email service like SendGrid or Mailgun. They offer SMTP relay services that are easier to set up and often more reliable for automation tasks. Just forward your Outlook emails there and use their SMTP settings in n8n.

hey mike, had the same issue. try turning on ‘Allow less secure apps’ in ur outlook security settings. also, double check ur app password - sometimes it’s easy to mix up characters. if that don’t work, maybe try port 465 with SSL/TLS on instead. good luck!