通过交换EWS API批准电子邮件 [英] Approve email message via exchange EWS API

查看:214
本文介绍了通过交换EWS API批准电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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?

推荐答案

这不是官方认可的方法,但是以下变通办法可以帮助我批准和拒绝主持人邮箱中的消息!

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

下面是完成任务的Powershell代码!

Below is a Powershell code that does the job!

注意事项:

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.

例如,要拒绝来自Moderator's Mailbox的邮件:

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!

这篇关于通过交换EWS API批准电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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