使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件 [英] Fetch Bounced emails from Office 365 mailbox using Microsoft Graph

查看:47
本文介绍了使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 SSIS 包,它使用 Outlook 自动发现 (Microsoft.Exchange.WebServices.dll) 从邮箱中提取未读电子邮件.我们的组织现在已经迁移到 Office 365,现在一切都在云上.我现在正在重写我的包以使用 Microsoft Graph.

I had a SSIS package that was fetching unread emails from a mailbox using Outlook Autodiscovery(Microsoft.Exchange.WebServices.dll). Our organization had now moved to Office 365 and everything is on cloud now. I am now rewriting my package to use Microsoft Graph.

我必须获取所有未读退回的电子邮件并对它们采取后续操作.以前,我可以通过检查 ItemClass 来检查退回的电子邮件:

I have to fetch all the unread bounced emails and take subsequent actions on them. Previously, I was able to check for bounced email by checking on the ItemClass:

// Check if its bounced mail
if (message.ItemClass == "REPORT.IPM.Note.NDR")

MS Graph 中是否有任何类似的属性或任何替代方法来获取退回的电子邮件?

Is there any similar property in MS Graph or any alternate approach to get bounced emails?

目前,我为此使用From"属性:

Currently, I am using the "From" attribute for this:

https://graph.microsoft.com/v1.0/me/mailFolders('Inbox')/messages?$search="from:MAILER-DAEMON@mg1.dhs.state.gov"

但我不想依赖发件人电子邮件地址(它可能会改变).更喜欢更健壮的方式.

But I don't want to rely on the from-email-address (it might change). Would prefer a more robust way.

推荐答案

如果要访问 ItemClass 属性,可以通过展开 SingleValueExtendedProperty 来实现:String 0x001A (0x001A001F).

If you want to access ItemClass property, you can do that by expanding SingleValueExtendedProperty: String 0x001A (0x001A001F).

GetMessageWithExtendedProperty

这篇关于使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆