Fetch Bounced emails from Office 365 mailbox using Microsoft Graph(使用 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 邮箱中获取退回的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:使用 Microsoft Graph 从 Office 365 邮箱中获取退回的电子邮件
基础教程推荐
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
