正在读取Inbox的另一个帐户的子文件夹的邮件 [英] Reading mails of Inbox's subfolder of another account

查看:57
本文介绍了正在读取Inbox的另一个帐户的子文件夹的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我正在尝试访问Outlook帐户并处理某些收件箱子文件夹中的所有电子邮件:



我可以访问此用户的收件箱,但不能访问子文件夹。



Hello,

I am trying to access an outlook account and process all the present emails on some Inbox''s subfolder:

I can access to this user''s inbox, but not the subfolder.

static void ReadMail()
    {


            Outlook.Application oApp = new Outlook.Application();

            Outlook.NameSpace oNS = oApp.GetNamespace("mapi");

            oNS.Logon(Missing.Value,Missing.Value,false,true);

                    Outlook.Recipient myRecipient = oNS.CreateRecipient("USERSMAILBOX");
                    myRecipient.Resolve();


                    Outlook.MAPIFolder oInbox = oNS.GetSharedDefaultFolder(myRecipient,                             Outlook.OlDefaultFolders.olFolderInbox);

                Outlook.Items oItems = oInbox.Items;

            Outlook.MailItem oMsg = (Outlook.MailItem)oItems.GetFirst();

                    MessageBox.Show(oMsg.Subject);

            oNS.Logoff();

            oMsg = null;
            oItems = null;
            oInbox = null;
            oNS = null;
            oApp = null;

    }





现在我能打印出这个用户内的邮件了'' s收件箱,但我如何获取子文件夹中的邮件,例如以subFolder命名?



BR,

pgb



Right now I am able to printout the mails inside this user''s inbox, but how can I fetch the mails inside a subfolder, named for example subFolder?

BR,
pgb

推荐答案

看看这是否有帮助



http://msdn.microsoft.com/en-US/library/ms268863(v = vs.80).aspx [ ^ ]



''g''
see if this helps

http://msdn.microsoft.com/en-US/library/ms268863(v=vs.80).aspx[^]

''g''


这篇关于正在读取Inbox的另一个帐户的子文件夹的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆