使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件

Fetch Bounced emails from Office 365 mailbox using Microsoft Graph(使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件)
本文介绍了使用 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 邮箱中获取退回的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

DispatcherQueue null when trying to update Ui property in ViewModel(尝试更新ViewModel中的Ui属性时DispatcherQueue为空)
Drawing over all windows on multiple monitors(在多个监视器上绘制所有窗口)
Programmatically show the desktop(以编程方式显示桌面)
c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
LINQ many-to-many relationship, how to write a correct WHERE clause?(LINQ多对多关系,如何写一个正确的WHERE子句?)