How to have an Outlook web add-in act on incoming emails?

uuid 21 Reputation points
2022-05-07T01:17:14.51+00:00

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
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.