Skip to main content
This notebook shows how to load email (.eml) or Microsoft Outlook (.msg) files. Please see this guide for more instructions on setting up Unstructured locally, including setting up required system dependencies.

Using Unstructured

Retain Elements

Under the hood, Unstructured creates different โ€œelementsโ€ for different chunks of text. By default we combine those together, but you can easily keep that separation by specifying mode="elements".

Processing Attachments

You can process attachments with UnstructuredEmailLoader by setting process_attachments=True in the constructor. By default, attachments will be partitioned using the partition function from unstructured. You can use a different partitioning function by passing the function to the attachment_partitioner kwarg.

Using OutlookMessageLoader


Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.