# Node-red-node-email example with Office 365

**URL:** <https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409>\
**Category:** General\
**Created:** [22 April 2024 08:50 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409 "2024-04-22T08:50:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [22 April 2024 08:50 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/1 "2024-04-22T08:50:19Z")

</div>

Hi all,

I need to send emails using the node-red-node-email node.  
In the past I used a Google email and everything worked easily thanks to the "Auth Type" option configured on "Basic".

But now I have to migrate the structure to an office 365 account but I'm really confused on how to use "Auth Type" in "XOAuth2" configuration.  
I see that a token is needed but I can't understand where I can get this token from, should I make an hhtp get request to the organization's office365 server? Or am I totally wrong? Could someone give me an implementation example? I couldn't find an example on the web

I add the image below to explain myself better  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/a/4a430bb08139e9f8c122395acec0ac32c5a1d160.png)

Thanks in advance for the support

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [22 April 2024 08:57 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/2 "2024-04-22T08:57:08Z")

</div>

According to [https://flows.nodered.org/node/node-red-node-email](https://flows.nodered.org/node/node-red-node-email)

> ## Office 365 users
> 
> If you are accessing Exchnage you will need to register an application through their platform and use OAuth2.0. [Details on how to do this can be found here.](https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth#get-an-access-token)

Have you visited that Microsoft page?

---

<div class="post-metadata">

**Author:** ![AutomationTeam-ATeam](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/automationteam-ateam/32/74550_2.png) [@AutomationTeam-ATeam](https://discourse.nodered.org/u/AutomationTeam-ATeam)\
**Post date:** [22 April 2024 10:01 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/3 "2024-04-22T10:01:04Z")

</div>

yes, but I don't undestand how I should take this token  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/a/5a63258265b192cedaada6e7dcae135eba2d441d.png)

An example for this would be really helpful 🙂

---

<div class="post-metadata">

**Author:** ![AndrewBeasley](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@AndrewBeasley](https://discourse.nodered.org/u/AndrewBeasley)\
**Post date:** [22 April 2024 12:28 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/4 "2024-04-22T12:28:05Z")

</div>

Who manages your 365 instance? Can you request the token config from them?

I've given up with O365 TBH but reading [this post](https://discourse.nodered.org/t/email-node-and-oauth-with-m365/77903) you need to get the token using the [node-red-contrib-oauth2 (node) - Node-RED](https://flows.nodered.org/node/node-red-contrib-oauth2) node.

I moved to SMTP2GO by the way - it way more manageable and does not impact any 'normal' mail accounts.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 April 2024 22:41 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/5 "2024-04-22T22:41:06Z")

</div>

For O365, you have to register your endpoint as an API endpoint in Azure Active Directory. When you do that, you will get the API tokens you need.

The use of the global cloud platforms like Azure and AWS is not simple and you should, as Andrew says, get support from your Azure/O365 admins since they will, in any case, be the only people permitted to register your API app.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [21 July 2024 22:41 UTC](https://discourse.nodered.org/t/node-red-node-email-example-with-office-365/87409/6 "2024-07-21T22:41:28Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
