使用 MAPI w/ C++,如何打开其他用户的收件箱?
我希望编写一个自动监视脚本,以编程方式从另一个用户的 Exchange 2003 收件箱中检索信息。 我有可用的 C++ 代码来登录 MAPI 并连接到我自己的收件箱。 我还可以使用“控制面板”->“邮件”小程序将其他用户的邮箱配置到我的个人资料中,并且我的代码可以通过这种方式进行访问。 不过,这是在安装了 Outlook 的桌面上完成的,它提供了更丰富的邮件配置文件编辑器。
由于它将在服务器上运行,因此我不想安装 Outlook。 相反,我可以安装 MAPI 客户端。 然后,我创建一个简单的 MAPI 应用程序,该应用程序使用带有 MAPI_LOGON_UI
标志的 MAPILogonEx()
弹出邮件配置文件向导。 但是,基本 MAPI 客户端不具备配置其他用户邮箱的功能。 作为要求,我只能作为监视应用程序的服务帐户运行此脚本,因此我无法告诉它作为我想要的邮箱的帐户运行。
是否仍然可以使用基本 MAPI 客户端连接到其他用户的邮箱(假设已授予权限)? 或者是否必须安装 Outlook 才能使用此功能?
I'm looking to write an automated monitor script to programmatically retrieve information from another user's Exchange 2003 inbox. I have working C++ code to log into MAPI and connect to my own inbox. I can also use the Control Panel->Mail applet to configure another user's mailbox into my profile, and my code can access that way. However, this was done on my desktop with Outlook installed, which provides a richer mail profile editor.
Since this will run on a server, I'd prefer not to install Outlook at all. Instead, I can install the MAPI client. I then create a simple MAPI app that pops up the mail profile wizard using MAPILogonEx()
with the MAPI_LOGON_UI
flag. However, the basic MAPI client doesn't have the features to configure another user's mailbox. As a requirement, I can only run this script as the service account of the monitoring application, so I cannot tell it to run as the account whose mailbox I want.
Is it still possible to connect to another user's mailbox (assuming permissions are already granted) using the basic MAPI client? Or is it absolutely necessary to install Outlook for this functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我强烈建议使用 Microsoft Exchange MAPI 客户端(如您所链接)。 它被设计为比这些库的 Outlook 版本更加强大。 您应该发现 Outlook 和 Exchange Server 之间的 API 在扩展 MAPI 方面没有什么不同。
您将需要使用扩展 MAPI(如 Cain TS Random 所描述)来打开其他邮件存储,当然您的应用程序需要以在 Exchange 服务器上具有适当权限的 Windows 用户身份登录。
I would strongly recommend using the Microsoft Exchange MAPI Client (as you have linked). It is engineered to be far more robust than the Outlook version of these libraries. You should find the API no different between Outlook and Exchange Server with respect to Extended MAPI.
You will need to use Extended MAPI (as described by Cain T S Random) to open other mail stores, and of course your application will need to be logged in as the Windows user with appropriate permissions on the Exchange server.
我明白了...我不知道如何明确地做到这一点; 这通常是使用错误标志调用
CreateStoreEntryID
的副作用。 您想要做的可能是:IID_IExchangeManageStore
CreateStoreEntryID
然后通过条目 ID 打开该存储
如果需要更详细的示例,请在 MFC MAPI 项目的源代码中搜索
CreateStoreEntryID
。 如果您有其他问题,获得解答的最佳位置是microsoft.public.win32.programmer.messaging
新闻组。I see... I'm not sure how to do that explicitly; that's usually a side effect of calling
CreateStoreEntryID
with the wrong flags. What's you're looking to do is probably:IID_IExchangeManageStore
from your default message storeCreateStoreEntryID
Then open that store by the entry ID
If you want a more detailed example, search the source of the MFC MAPI project for
CreateStoreEntryID
. If you have other questions, the best place to get them answered is themicrosoft.public.win32.programmer.messaging
newsgroup.您研究过ConfigureMsgService 吗? 我相信这适用于 Exchange MAPI,或者您是说您尝试过但它不起作用?
Have you looked into ConfigureMsgService? I believe that works with Exchange MAPI, or are you saying you tried that and it didn't work?