Connecting to Public Folders using RDO & MAPI

本文关键字:amp MAPI RDO using to Public Folders Connecting | 更新日期: 2023-09-27 18:22:48

我正在尝试使用RDO&MAPI,我以前从未做过。我发现了一个很好的网站,使用Outlook的赎回(http://www.dimastr.com/redemption/home.htm)但由于网站上所有的例子都使用VB.NET,而我又不擅长编程,所以要做到这一点有点困难。

到目前为止,我有这个代码

static void ConnectToExchange()
    {
        object oItems;
        //string outLookUser = "My Profile Name";
        string outLookUser = "username@xxx.xxxx";
        string ToEmailAddress = "username@xxxx.com";
        string FromEmailAddress = "username@xxx.com";
        string outLookServer = "xxservernamexx";
        string sMessageBody =
            "'n outLookUser: " + outLookUser +
            "'n outLookServer: " + outLookServer +
            "'n'n";
        RDOSession Session = new RDOSession();
        try
        {                                               
            Session.LogonExchangeMailbox(outLookUser,outLookServer);
            int mailboxCount = Session.Stores.Count;
            string defaultStore = Session.Stores.DefaultStore.Name;
            RDOFolder TestTaxCert = Session.GetFolderFromPath(@"''Public Folders'All Public Folders'TestTaxCert");

        }
        catch (Exception ex)
        {
            Session = null;
            //System.Web.Mail.SmtpMail.Send(ToEmailAddress, FromEmailAddress, "Error", sMessageBody + " " + ex.Message);
        }
        finally
        {
            if ((Session != null))
            {
                if (Session.LoggedOn)
                {
                    Session.Logoff();
                }
            }
        }
    }
}

我的问题是,一旦程序到达Session.LogonExchangeMailbox(outLookUser,outLookServer);行,就会出现一个提示,询问我的凭据(用户名、域、密码),无论我向提示提供了什么信息,它都拒绝了权限。

所以,如果有人能帮我,然后连接到公共文件夹。。。那将是greaaat

Connecting to Public Folders using RDO & MAPI

确保您的代码以LogonExchange邮箱调用中指定的域用户身份运行。你说的是2003年,还是Exchange 2013?