You can Authenticate your device directly with a Microsoft 365 or Office 365 mailbox and send mail using SMTP AUTH client submission. To achieve that please follow this documentation https://learn.microsoft.com/en-us/exchange/mail-flow-best-practices/how-to-set-up-a-multifunction-device-or-application-to-send-email-using-microsoft-365-or-office-365
Hope this helps!
Remember to accept the answer if it is helpful.