Send email notifications using gmail works, but unfortunately not using Office 365

In my previous question I was asking on how to configure gmail for sending email, I figured it out myself and it works. This time I want to send using Office 365.
It’s the same menu under: Webmin -> Webmin configuration -> Sending Email, just changed the fileds from gmail to Office 365.
Here’s a screenshot: https://ibb.co/gE12E7
I tried changing “SMTP authentication method” to either “Plain” and “Login”, but unfortunately neither works and I get:

"Sending message from s***@samedomainname.com to username@samedomainname.com
… sending failed : SMTP command failed : . ".

How to configure the email settings correctly?

Anyone? Microsoft writes here https://support.office.com/en-us/article/how-exchange-online-uses-tls-to-secure-email-connections-in-office-365-4cde0cda-3430-4dc0-b489-f2c0736c929f that they use TLS, no SSL available. nmap confirms that only port 587 (TLS) is available at smtp.office365.com, not 465 (SSL). Gmail supports both TLS and SSL. I can’t imagine that Webmin wouldn’t support TLS – Does Webmin support TLS?

How did you set up gmail to send emails?