通过Exchange EWS API批准电子邮件

Kes*_*shi 5 exchangewebservices office365

我有一种情况,我需要将邮件重新路由到另一个将成为主持人的邮箱.以编程方式 - 有没有办法批准我在主持人邮箱中收到的消息?我没有在EWS中看到它的明确支持.微软是否支持这种其他API类型?

Shu*_*ham 3

这不是官方批准的方式,但以下解决方法可以帮助我批准和拒绝版主邮箱中的邮件!

下面是Powershell完成这项工作的代码!

注意事项:

Item Classes: $EmailMessage.ItemClass = "IPM.Note.Microsoft.Approval.Reply.Approve" $EmailMessage.ItemClass = "IPM.Note.Microsoft.Approval.Reply.Reject"
Run Code Online (Sandbox Code Playgroud)

Subject - Use the Normalized subject from the approval Request email and then append Accept or Reject.

RecipientTo - Needs to be set to the Microsoft Exchange Approval Assistant Address.

例如,拒绝来自以下地址的邮件Moderator's Mailbox

$PR_REPORT_TAG = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition(0x0031,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::Binary);
$VerbResponse = new-object Microsoft.Exchange.WebServices.Data.ExtendedPropertyDefinition([Microsoft.Exchange.WebServices.Data.DefaultExtendedPropertySet]::Common,0x8524,[Microsoft.Exchange.WebServices.Data.MapiPropertyType]::String);  

$ReportID = $null
[Void]$Item.TryGetProperty($PR_REPORT_TAG,[ref]$ReportID)
$EmailMessage.SetExtendedProperty($VerbResponse,"Reject")
$EmailMessage.SetExtendedProperty($PR_REPORT_TAG,$ReportID)
Run Code Online (Sandbox Code Playgroud)

请看一下这个链接!解释得很好!