Class EmlToMarkdown
- Namespace
- LMKit.Document.Conversion
- Assembly
- LM-Kit.NET.dll
Provides conversion methods from email files - EML, and Outlook MSG read as the same message - to Markdown.
public static class EmlToMarkdown
- Inheritance
-
EmlToMarkdown
- Inherited Members
Examples
using LMKit.Document.Conversion;
byte[] emlBytes = File.ReadAllBytes("message.eml");
string markdown = EmlToMarkdown.Convert(emlBytes);
Remarks
Converts EML and Outlook MSG email messages into structured Markdown, preserving headers (From, To, Cc, Date, Subject) as a metadata block and the email body as Markdown content. HTML-only emails are converted to Markdown automatically, preserving links, formatting, and structure.
Attachments and inline images are listed at the end of the Markdown output with file name, MIME type, and size. Calendar events (ICS) are extracted and rendered as structured sections when present.
Methods
- Convert(byte[], bool, CancellationToken)
Converts an EML or Outlook MSG file (as a byte array) to Markdown.
- Convert(string, bool, CancellationToken)
Converts an EML or Outlook MSG file at the specified path to Markdown.
- ConvertAsync(byte[], bool, CancellationToken)
Asynchronously converts an EML or Outlook MSG file (as a byte array) to Markdown.
- ConvertAsync(string, bool, CancellationToken)
Asynchronously converts an EML or Outlook MSG file at the specified path to Markdown.