As a recommendation, please note that Microsoft disables Authenticated SMTP by default for all mailboxes. Even if you are using a valid OAuth token, SMTP authentication will fail if this setting is not enabled.
To fix this, go to the Microsoft 365 Admin Center → Users → Active users, select the mailbox used by Mendix, open the Mail tab, and click Manage email apps. Make sure Authenticated SMTP is enabled and saved.
Ensure that the below: