Call Features.Container property to check if container extraction is supported;
Call GetContainer method and obtain collection of document container item objects;
Iterate through the collection and get Parser object for each item.
The following example shows how to extract emails from Exchange Server:
// Create the connection object for Exchange Web Services protocol EmailConnectionconnection=newEmailEwsConnection("https://outlook.office365.com/ews/exchange.asmx","email@server","password");// Create an instance of Parser class to extract emails from the remote serverusing(Parserparser=newParser(connection)){// Check if container extraction is supportedif(!parser.Features.Container){Console.WriteLine("Container extraction isn't supported.");return;}// Extract email messages from the serverIEnumerable<ContainerItem>emails=parser.GetContainer();// Iterate over attachmentsforeach(ContainerItemiteminemails){// Create an instance of Parser class for email messageusing(ParseremailParser=item.OpenParser()){// Extract the email textusing(TextReaderreader=emailParser.GetText()){// Print the email textConsole.WriteLine(reader==null?"Text extraction isn't supported.":reader.ReadToEnd());}}}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to parse documents and extract data from PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Parser App.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.