To send the email using office 365 exchange mail server, according to the Microsoft documentation office 365 exchange mail server API is discoverable using the email id and the password where the email id should be like onmicrosft.com (e.g. email@example.com, firstname.lastname@example.org) and there should be a license for the exchange mail which should be assigned to that specific email id. If these things are in place then the Microsoft exchange mail server api will able to discover the service path to send the mail. This is an alias that microsoft use on each email, for exapmle Azure@ellerfield.com.au = email@example.com
If you need great Financial Advise check out www.ellerfield.com.au.