Julexe
Julexe

Reputation: 23

Does automatic reply from outlook have a flag or something in the API?

I am using the Python Outlook API to automate some logic between outlook and some other APIs. Everything is great but I see that sometimes, when I send message to people, they are off and I receive their automatic replies. Then it causes issue because this answer can be understand as a request in the mailbox. So far to avoid this issue I parse the subject because outlook is writing the same title beginning with "Aumomatic Reply:", but I received the japanese version of this subject from a japanese customer. To avoid having to handle this issue in every language, I would like to handle all the automatic reply easely.

So my question is, does mail from automatic reply has an attribute or a flag in the API ? On outlook there is something like this, maybe it can be used/fetch somewhere: Automatic reply logo

Upvotes: 1

Views: 248

Answers (1)

Eugene Astafiev
Eugene Astafiev

Reputation: 49397

If you try to automate Outlook on your end you may find the ReportItem class helpful. The ReportItem object is similar to a MailItem object, and it contains a report (usually the non-delivery report) or error message from the mail transport system.

Unlike other Microsoft Outlook objects, you cannot create this object. Report items are created automatically when any report or error in general is received from the mail transport system.

So, you can handle the NewMailEx event of the Application class where you may check out the message class of the item received to the Inbox. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item (passed as a parameter to the event handler). The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. Use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.

Upvotes: 1

Related Questions