Due to security requirements, many Microsoft 365 tenants now block the use of Authenticated SMTP with Outlook/Exchange. Basic authentication for login was permanently disabled on 1 October 2022, though Authenticated SMTP has not been officially depreciated by Microsoft at time of writing.
Learn more directly from Microsoft here: https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online