MATLAB Answers

How I could set up a listener and for an event (new email in my mailbox) in Outlook with MATLAB?

1 view (last 30 days)
I need to listen the mails (of my Outlook mailbox) and if a new mail comes in my mailbox to trigger a function.

Accepted Answer

Mario Malic
Mario Malic on 31 May 2021
When numUnreads changes, you can run your function.
hOutlook = actxserver('Outlook.Application');
nameSpace = hOutlook.GetNamespace("MAPI");
inboxFolder = nameSpace.GetDefaultFolder(6); %
numUnreads = inboxFolder.UnReadItemCount

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by