Is there a way to accurately identity bounced back email notifications in a mailbox using EWS? So far I`ve looked at the message headers and nothing seems to indicate that the message is an email bounce notification.
I also looked at the Item
and the EmailMessage
members and haven't found anything useful (I may have missed something).
I could always parse the sender which always says 'Email Delivery System' or the subject line or even the message body, but I'm looking for a cleaner way to do that.
Try the ItemClass property.
This corresponds to PR_MESSAGE_CLASS MAPI property. This link provides some values for this property. You can find there a list of message classes for different types of messages. Some of them are for Non-Delivery reports, which I think is what you want.
It seems that if this property value starts with "REPORT.IPM" and ends with ".NDR" then its a Non-delivery report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With