【问题标题】:Create Outlook MAPI Profile with IProfAdmin interface c++使用 IProfAdmin 接口 c++ 创建 Outlook MAPI 配置文件
【发布时间】:2016-01-25 08:55:44
【问题描述】:

我在 C++ 方面的知识非常有限,但我正在尝试使用此示例代码以编程方式创建 mapi 配置文件:

https://support.microsoft.com/en-us/kb/306962

我编译了代码,但示例功能对我来说还不够,因为它只添加了:ProfileName、MailboxName 和 Server,

我还想添加 RPC 代理服务器(通过 HTTP 连接)以及像此窗口这样的所有设置:

正如我在 profiler.cpp 代码中看到的那样,邮箱名称和服务器位于这部分:

// First, server name
ZeroMemory(&rgval[1], sizeof(SPropValue) );
rgval[1].ulPropTag = PR_PROFILE_UNRESOLVED_SERVER;
rgval[1].Value.lpszA = szServer;

// Next, the mailbox name
ZeroMemory(&rgval[0], sizeof(SPropValue) );
rgval[0].ulPropTag = PR_PROFILE_UNRESOLVED_NAME; 
rgval[0].Value.lpszA = szMailbox;

标签/属性位于 EdkMdb.h 文件中,所以我尝试添加以下行:

#define PR_PROFILE_RPC_PROXY_SERVER_FLAGS PROP_TAG( PT_LONG, pidProfileMin,0x2F)
#define PR_PROFILE_RPC_PROXY_SERVER_AUTH_PACKAGE (PT_LONG, pidProfileMin,0x1)
#define PR_PROFILE_RPC_PROXY_SERVER     PROP_TAG(PT_UNICODE, 0x6622001F)

扩展rgval 数组

SPropValue      rgval[5];               // Property structure to hold values we want to set

然后将此行添加到 profiler.cpp

ZeroMemory(&rgval[2], sizeof(SPropValue));
rgval[2].ulPropTag = PR_PROFILE_RPC_PROXY_SERVER;
rgval[2].Value.lpszA = "mail.domain.com";

ZeroMemory(&rgval[3], sizeof(SPropValue));
rgval[3].ulPropTag = PR_PROFILE_RPC_PROXY_SERVER_FLAGS;
rgval[3].Value.ul = 0x1;

ZeroMemory(&rgval[4], sizeof(SPropValue));
rgval[4].ulPropTag = PR_PROFILE_RPC_PROXY_SERVER_AUTH_PACKAGE;
rgval[4].Value.ul = 0x2;

并在此处更改“属性数为 5”:

 if (FAILED(hRes = lpSvcAdmin->ConfigureMsgService(
        (LPMAPIUID)lpSvcRows->aRow->lpProps[iSvcUID].Value.bin.lpb, // Entry ID of service to configure
        NULL,                                                       // Handle to parent window
        0,                                                          // Flags
        5,                                                          // Number of properties we are setting
        rgval))) 

但是没有效果,新配置文件中没有配置Proxy设置,

我做错了什么或错过了什么?

感谢您的帮助, 谢谢

【问题讨论】:

    标签: c++ outlook mapi


    【解决方案1】:

    如果您需要创建 RPC-over-HTTP 连接,您需要设置很多属性。见http://blogs.msdn.com/b/dvespa/archive/2014/01/17/how-create-outlook-profile-office-365.aspx

    在 Outlook 2016 中,事情要容易得多 - 您基本上只需要提供 SMTP 地址:请参阅 http://blogs.msdn.com/b/dvespa/archive/2015/10/29/how-to-configure-an-outlook-2016-profile-using-mfcmapi.aspx

    【讨论】:

    • 谢谢,设置所有属性,仍然无法正常工作,未检查通过 http 的 RPC,我已经使用了 10 个小时,快疯了,请帮助...顺便说一句,我不是在 Outlook spy 中查看任何这些属性
    • 您是否使用 OutlookSpy(单击 IProfAdmin)比较了好的和坏的配置文件?
    猜你喜欢
    • 1970-01-01
    • 2014-08-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-21
    • 2011-08-27
    • 1970-01-01
    相关资源
    最近更新 更多