This is some general instructions for the next person who wants to send their invoices through Office 365 without forcing Office 365 SMTP to be turned on (Because Microsoft will permanently disable it later this year). The first issue is that Invoice Ninja doesn’t support OAuth, but the second issue under the hood is that even if you get OAuth proxied, the SMTP Auth that Ninja uses is what will also be turned off by Microsoft. This part isn’t clear which is why it gets so confusing; the answer is to the use the Graph API in Office 365 to send the emails. Without getting you need a proxy to take standard SMTP commands like Ninja provides, and then do both an OAuth authentication with Office365 and then have that proxy accept the SMTP email from Ninja and re-send it through 365 using Graph API commands.
GPT and I created a python script to do all of the above, i run it on a machine on my Lan and then Ninja just sends its SMTP commands over to it. You do need go into Azure App registrations and create an app and enable the Graph API for sending email but after that just plugging the client/tenant ID’s and keys into the python script and everything works.