I’ve tested it with Quickmail and this is the debug info:
Server Debug Information:
2024-01-15 09:45:32 SERVER → CLIENT: 220 XXXXXXXXXXXX.XXXXXXX.office365.com Microsoft ESMTP MAIL Service ready at Mon, 15 Jan 2024 09:45:31 +0000
2024-01-15 09:45:32 CLIENT → SERVER: EHLO www.domain.com
2024-01-15 09:45:32 SERVER → CLIENT: XXXXXXXXXXXX.XXXXXXX.office365.com Hello [XX.XXX.XXX.XXX]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2024-01-15 09:45:32 CLIENT → SERVER: STARTTLS
2024-01-15 09:45:32 SERVER → CLIENT: 220 2.0.0 SMTP server ready
2024-01-15 09:45:32 CLIENT → SERVER: EHLO www.domain.com
2024-01-15 09:45:32 SERVER → CLIENT: XXXXXXXXXXXX.XXXXXXX.office365.com Hello [XX.XXX.XXX.XXX]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
2024-01-15 09:45:32 CLIENT → SERVER: AUTH LOGIN
2024-01-15 09:45:32 SERVER → CLIENT: 334 VXNlcm5hbWU6
2024-01-15 09:45:32 CLIENT → SERVER: [credentials hidden]
2024-01-15 09:45:32 SERVER → CLIENT: 334 UGFzc3dvcmQ6
2024-01-15 09:45:32 CLIENT → SERVER: [credentials hidden]
2024-01-15 09:45:38 SERVER → CLIENT: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [LO4P302CA0036.GBRP302.PROD.OUTLOOK.COM 2024-01-15T09:45:38.430Z 08DC150C2C489E6C]
2024-01-15 09:45:38 SMTP ERROR: Password command failed: 535 5.7.139 Authentication unsuccessful, the request did not meet the criteria to be authenticated successfully. Contact your administrator. [XXXXXXXXXXXXXX.PROD.OUTLOOK.COM 2024-01-15T09:45:38.430Z 08DC150C2C489E6C]
SMTP Error: Could not authenticate.
2024-01-15 09:45:38 CLIENT → SERVER: QUIT
2024-01-15 09:45:38 SERVER → CLIENT: 221 2.0.0 Service closing transmission channel
SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub