Approve email message via exchange EWS API

冷暖自知 提交于 2019-12-10 14:03:50

问题


I have a situation where I would need to re-route messages to a different mailbox who would be the moderator. Programmatically - is there a way to approve the message I get in the moderator's mailbox? I dont see explicit support in EWS for it. Does any other API type that microsoft has support this?


回答1:


This is not an official approved way but the following workaround worked for me to approve and reject messages in the moderator's mailbox!

Below is a Powershell code that does the job!

Things to Note:

Item Classes: $EmailMessage.ItemClass = "IPM.Note.Microsoft.Approval.Reply.Approve" $EmailMessage.ItemClass = "IPM.Note.Microsoft.Approval.Reply.Reject"

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.

For Example, to Reject a mail from the 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)

Do take a look at this link! It's nicely explained!




回答2:


This isn't possible via the Graph or Outlook REST APIs.

You might be able to accomplish this using Transport Rules. There is a scenario documented for setting up an Email Approval Chain that sounds similar. This is a configuration procedure however, not a REST API.



来源:https://stackoverflow.com/questions/43359295/approve-email-message-via-exchange-ews-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!