EWS托管API-如何将项目从一个邮箱复制到另一个邮箱 [英] EWS Managed API - How to copy items from one mailbox to other
问题描述
我正在编写一个应用程序(C#),用于将联系人,约会,任务等从一个邮箱同步到另一个邮箱.我能够使用SyncFolderItems检索对这些项目的更改,但是找不到将更改复制到其他邮箱的方法.看来我必须为目标邮箱上的所有这些类型创建一个新项目.如果是这种情况,我如何将源项目中的所有属性放到目标中的新项目上.我目前正在使用Exchange 2007 sp1环境,并且还希望对Exchange 2010使用相同的代码.
I am writing an application(C#) to sync contacts,appointments,tasks etc from one mailbox to other. I am able to retrieve changes to these items using SyncFolderItems but could not find a way to copy the changes to a different mailbox. It looks like I have to create a new item for each of these types on the destination mailbox. If that is the case how do I get all the properties on the source item onto the new item on the destination. I am currently using exchange 2007 sp1 environment and want to use the same code for exchange 2010 also.
推荐答案
(这对我在Exchange 2010上起作用.文档未提及2007,因此您可能不走运.)
(This is what worked for me on Exchange 2010. The docs don't mention 2007 so you may be out of luck there.)
使用 SyncFolderItems
查找要移动的物品.接下来,使用 ExportItems
导出它们到文件,然后 UploadItems
将它们放入另一个邮箱. 使用Exchange Online进行ExportItems和UploadItems操作非常详细,并提供了导入/导出操作的示例(包括源和目标是不同邮箱的示例).
Use SyncFolderItems
to find the items you want to move. Next, use ExportItems
to export them to a file, and then UploadItems
to put them into the other mailbox. ExportItems and UploadItems operations with Exchange Online is very detailed and has examples of the import/export operation (including an example where the source and destination are different mailboxes).
这篇关于EWS托管API-如何将项目从一个邮箱复制到另一个邮箱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!