Skip to main content
This notebook shows how to load email (.eml) or Microsoft Outlook (.msg) files. Please see Unstructured 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