使用EWS API搜索不同用户的邮箱

发布于 2024-08-08 13:18:52 字数 403 浏览 1 评论 0原文

我们正在开发一个模块,其主要目标是跟踪和收集有关损坏检查(保险市场)的信息。每个箱子都有一个代码(例如L000525)。每个案件可以由几个人管理。与特定案例相关的所有电子邮件的主题中均包含案例代码。

我们想要做的是收集并显示与每个特定案例相关的传入和发送的电子邮件。

这个想法是,任何用户都可以打开“案例管理”窗口,选择特定案例,然后获取所有相关信息(当然包括电子邮件)。

我们必须在大约 20 个用户的邮箱中找到电子邮件。所以问题是:

  • 哪种方法更好?会消耗大量的时间和资源吗?

我们是 Exchange 世界的新手,因此我们正在考虑 Exchange 模仿,但我们根本不确定。该模块是在Silverlight 3、WCF、SQL Server + Exchange 2007中开发的。

We are developing a module with the main goal being to track and collect information about damage inspections (insurance market). Each case has a code (e.g. L000525). Each case could be managed by several people. All the emails related to a specific case include the case code in the subject.

What we want to do is to collect and show the incoming and sent emails related to each specific case.

The idea is that any user can open a "Case management" window, select an specific case, and then get all the related information (including the emails of course).

We have to find the emails into the the mailboxes of around 20 users. So the questions are:

  • Which is the better way to do this? Will it consume a lot of time and resources?

We are new in the Exchange world so we are thinking Exchange impersonation, but we are not sure at all. The module is developed in Silverlight 3, WCF, SQL Server + Exchange 2007.

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

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

发布评论

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

评论(2

萧瑟寒风 2024-08-15 13:18:52

如果用于连接到 EWS 的凭据有权访问用户的邮箱,那么您应该能够执行如下操作:

var service = new ExchangeService();
service.Credentials = new WebCredentials("[email protected]", "password");
service.AutodiscoverUrl("[email protected]");

var userMailbox = new Mailbox("[email protected]");
var folderId = new FolderId(WellKnownFolderName.Inbox, userMailbox);

var itemView = new ItemView(20);   // page size
var userItems = service.FindItems(folderId, itemView);

foreach (var item in userItems)
{
    // do something with item (nb: it might not be a message)
}

就是这样。哇,我的第一个答案!

If the credentials used to connect to EWS have rights to access a user's mailbox then you should be able to do something like this:

var service = new ExchangeService();
service.Credentials = new WebCredentials("[email protected]", "password");
service.AutodiscoverUrl("[email protected]");

var userMailbox = new Mailbox("[email protected]");
var folderId = new FolderId(WellKnownFolderName.Inbox, userMailbox);

var itemView = new ItemView(20);   // page size
var userItems = service.FindItems(folderId, itemView);

foreach (var item in userItems)
{
    // do something with item (nb: it might not be a message)
}

That's it. Wow, my first SO answer!

如歌彻婉言 2024-08-15 13:18:52

@smcintosh 上述操作的完整示例如下: Office365 API - 管理员访问其他用户/房间的日历事件。它是一个完整的 java 类,应该编译、运行并访问房间资源日历。祝你好运!

A full working example of what @smcintosh has done above is here: Office365 API - Admin accessing another users/room's calendar events. It is a full java class that should compile and run and accesses a room resource calendar. Good luck!

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