Hi Simonas,
Your M365 tenant will need to be configured to support SMTP AUTH, you can find instructions on the different options here, How to set up a multifunction device or application to send email using Microsoft 365 or Office 365 | Microsoft Learn.
As the long-term plan for Microsoft for SMTP is to move to OAUTH, we plan on releasing SMTP OAUTH support in the next release of PPE (11.1), which is planned for later this year.