Office365 smtp not working

I’m running Nextcloud on Ubuntu 22.04.2 LTS. I’ve been unsuccessful with getting Nextcloud to send mail via smtp.office365.com and getting this error

A problem occurred while sending the email. Please revise your settings. (Error: Failed to authenticate on SMTP server with username “username@hostname” using 1 possible authenticators. Authenticator LOGIN returned Expected response code 250 but got code “535”, with message "535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [CH0PR03CA0085.namprd03.prod.outlook.com 2023-04-06T15:42:51.009Z 08DB368285175829]
".)

The account that’s being used in valid because we have other clients which are able to use it.

Any help would be greatly appreciated.

please raise a ticket against M365!

Have you tried using an app password for the login?

Where do i submit a ticket to Nextcloud?

Hi KarlF12, I’m using the 365 credentials that all other hosts use.

Could you post your SMTP configuration?

1 Like

Screen Shot 2023-04-07 at 10.01.43 AM

Didn’t Microsoft disable smtp last year and you need to explicitly enable it ?!

We have it successfully working for a number of Wordpress boxes.

It’s working on other devices using the same account and FROM address?

1 Like

Error code 5.7.139 isn’t even on their list of error codes so it’s hard to say exactly what might be the issue.

1 Like

That is correct, is seems to be an issue that a lot of people are running into.

I guess the next step will able to reach out to Azure support.

Which nextcloud version are you using?

25.0.5 current release.

So just to clarify because this is a little odd, your Wordpress servers are using this same SMTP setup AND sending as nextcloud@whatever?

No, each box has its own independent shared mailbox in Office365 which in turn has the send as permissions to allow a delegate to send email from their mailbox. So nextcloud@whatever, wordpress@whatever and so on.

Try using a known working sending address just to rule out anything having to do with that.

This is an older post but someone posted you can’t send with SMTP from a shared mailbox with send-as permission. Don’t know if that’s still the case or not.

I would consider using a relay connector instead. It’s a little more work on the front end, but then you don’t run into auth issues.

This topic was automatically closed after 10 days. New replies are no longer allowed.