I presume you’re familiar with the MS Graph API.
Well, a while ago I implemented a subflow, that sends email using the API.
It could make for an interesting resource for you.
https://discourse.nodered.org/t/o365-graph-mail-sender-subflow/
I built it In view that SMTP isn’t going to be around in the future, with Microsoft pushing the azure platform hard these days.
For our legacy systems, that still use the SMTP protocol, I built a dumb SMTP ingress server in node, that just sends the payload to this subflow.
These legacy systems are using the azure platform without knowing