使用 Exchange Web 服务操作搜索电子邮件

发布于 2024-08-06 20:56:12 字数 238 浏览 1 评论 0原文

我正在为运行 Microsoft Exchange 2007 (BPOS) 的客户做一个集成项目。我正在寻找一种使用 Exchange Web 服务操作(MS 的 API 到他们自己的托管交换解决方案)来搜索电子邮件的方法。到目前为止,我已经找到了一个很好的 API 描述,但据我所知,它都不允许使用不同的条件搜索电子邮件。在本例中,我需要查找包含由电子邮件地址标识的特定发件人或收件人的所有电子邮件。

您能为我提供如何执行此操作的指导吗?谢谢。

I am doing an integration project for a customer running Microsoft Exchange 2007 (BPOS). I am looking for a way to search for e-mail using the Exchange Web Services Operations -- MS' API to their own hosted exchange solution. So far, I have found a nice API description, but as far as I can see none of it allows for searching for e-mails using different criteria. In this case, I need to find all e-mails that contains a specific sender or recipient identified by an e-mail address.

Could you provide me with guidance on how to do this? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉墨 2024-08-13 20:56:12

根据我使用 Exchange Web 服务的经验(诚然是最少的),执行此操作的唯一方法是检索文件夹中的所有项目并扫描其属性。

您需要指定在调用 FindItem() 操作时检索哪些属性。

PathToUnindexedFieldType fieldTypePath = new PathToUnindexedFieldType();
fieldTypePath.FieldURI = UnindexedFieldURIType.folderDisplayName;

GetFolderType folderType = new GetFolderType();
folderType.FolderShape = new FolderResponseShapeType();
folderType.FolderShape.BaseShape = DefaultShapeNamesType.IdOnly;
folderType.FolderShape.AdditionalProperties = new BasePathToElementType[1];
folderType.FolderShape.AdditionalProperties[0] = fieldTypePath;

因此,唯一的优点是您不需要检索完整的电子邮件正文等 - 只需检索您明确需要的字段。

In my (admittedly minimal) experience with Exchange Web Services, the only way to do this would be to retrieve all items in a folder and scan through their properties.

You need to specify which properties are retrieved when you call the FindItem() operation.

PathToUnindexedFieldType fieldTypePath = new PathToUnindexedFieldType();
fieldTypePath.FieldURI = UnindexedFieldURIType.folderDisplayName;

GetFolderType folderType = new GetFolderType();
folderType.FolderShape = new FolderResponseShapeType();
folderType.FolderShape.BaseShape = DefaultShapeNamesType.IdOnly;
folderType.FolderShape.AdditionalProperties = new BasePathToElementType[1];
folderType.FolderShape.AdditionalProperties[0] = fieldTypePath;

So the only saving grace is that you don't need to retrieve the full email body etc - just the fields you explicitly require.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文