Probably because SMTP Basic Auth is disabled in the tenant:
https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/deprecation-of-basic-authentication-exchange-online
Note you can reenable it, but only until Oct of this year:
https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission
If that is the case, then you will need to find another solution soon using Modern Auth or not sending through 365