Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

Exchange folders

Last post 06-23-2009, 3:59 AM by saqib.razzaq. 1 replies.
Sort Posts: Previous Next
  •  06-20-2009, 5:35 PM 184709

    Exchange folders .NET

    hi,

    How can I get a list of all inbox folders, and then recurse through all those subfolders and save the messages as msg files?

    It seems the exchangeclient object only supports listing messages in the inbox, or other root folders, not subfolders, or am I missing something.  

    Also guarantee access via IMAP or POP3, as if I roll this application out to customers, I dont want to be telling them to activate something on their server that isnt already, so is there something available in aspose.network.exchange?

    Many thanks in advance,

    Mark
     
  •  06-23-2009, 3:59 AM 185016 in reply to 184709

    Re: Exchange folders .NET

    Hi Mark,

    Thanks for considering Aspose.

    ExchangeClient has ListMessages() method to get all the messages from an exchange folder. You can use the overloaded method ListMessages(string folder, bool recursive) to get messages from subfolders too. Sample code is given below:

    NetworkCredential credential = new NetworkCredential(username, password, domain);

    ExchangeClient client = new ExchangeClient(mailboxUri, credential);

    ExchangeMailboxInfo mailbox = client.GetMailboxInfo();

    ExchangeMessageInfoCollection msgInboxCollection = client.ListMessages(mailbox.InboxUri, true);

    Regarding Pop3 and Imap, will you be using exchange server or is this requirement of another application. I would recommend to use ExchangeClient class for managing emails on Exchange server.


    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
View as RSS news feed in XML