
How to have an Outlook web add-in act on incoming emails?
We are trying to build an Outlook web add-in that acts on incoming emails without requiring a manual trigger from the user. We don't know how to implement this, despite spending countless hours looking through the docs!
Specifically, when an email is received, the add-in should act on that email — e.g. sorting it into a folder, sending an automatic reply on behalf of the user, etc. We don't know how to handle the "when an email is received" part.
We'd hoped event-based activation would work, but it won't because the supported events don't include anything like OnMessageReceived
.
We'd also hoped we could approximate "when an email is received" by checking peridiocally for new mail (say, every 2 minutes). But it's crucial that the user doesn't have to manually kick off that process every time they open Outlook because that's way too laborious! (It wouldn't be a problem if they had to manually kick of the process one time — when they first install the add-in — and not after that.)
Is there any way to implement this, even in a more approximate way like checking periodically for new mail? If so, what is the best approach?
Thank you!
Microsoft 365 and Office | Development | Other
