Office365: Temporary server error. Please try again later. PRX4
When using SMTP with Office365 and OAUTH 2.0 you may receive this error:
Temporary server error. Please try again later. PRX4
SMTP logs look like this:
Connecting to ‘outlook.office365.com:587’, SSL/TLS: False.
S: 220 AS8PR04CA0136.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 28 Jan 2021 15:43:35 + 0000
C: EHLO[IPv6:2a02:]
S: 250-AS8PR04CA0136.outlook.office365.com Hello[2a02:]
S: 250-SIZE 157286400
S: 250-PIPELINING
S: 250-DSN
S: 250-ENHANCEDSTATUSCODES
S: 250-STARTTLS
S: 250-8BITMIME
S: 250-BINARYMIME
S: 250-CHUNKING
S: 250 SMTPUTF8
C: STARTTLS
S: 220 2.0.0 SMTP server ready
C: EHLO[IPv6:2a02:]
S: 250-AS8PR04CA0136.outlook.office365.com Hello [2a02:]
S: 250-SIZE 157286400
S: 250-PIPELINING
S: 250-DSN
S: 250-ENHANCEDSTATUSCODES
S: 250-AUTH LOGIN XOAUTH2
S: 250-8BITMIME
S: 250-BINARYMIME
S: 250-CHUNKING
S: 250 SMTPUTF8
C: AUTH XOAUTH2 dXNlcj1B...EEBAQ==
S: 451 4.7.0 Temporary server error. Please try again later. PRX4[AS8PR04CA0136.eurprd04.prod.outlook.com]
It is a bug when setting up an office365 business account with Microsoft.
After creating the e-mail account, you have to edit the account (go to https://admin.microsoft.com/)


Then go to “Mail” tab then click “Manage email apps”

There is an option called “Authenticated SMTP”. It is ticked by default, however to actually make it work you have to uncheck it and save the changes, then go back in and re-check it and save the changes.

You may need to leave it unchecked for some time and wait for some time when it is rechecked before it starts working:
C: AUTH XOAUTH2 dXNlcj1B...BAQ==
S: 235 2.7.0 Authentication successful
C: QUIT