Search code examples
node.jsoutlookoffice-jsoutlook-web-addins

Outlook Add-in NodeJS : get mail received notification


I am trying to write an Outlook add-in in NodeJS which reads the content of a mail and search for some specific strings. To do so, I need to get a notification when a new mail is received.

However, the event-based actions described in the Microsoft documentation only seem to refer to writing/sending mails, and not receiving them : https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/autolaunch

Has anyone ever dealt with this situation, or would be able to lead me to the proper notification ? I am searching the "OnMessageReceived" kind of event.


Solution

  • Outlook web add-ins work under the context of currently selected item only. You can handle item-level events only (or selection change with a pinnable task pane).

    Consider using Microsoft Graph API for handling incoming emails, see Q: How to handle all inbound and outbound mails in Office365/Exchange online? for more information.