---
title: "Overview"
canonical_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/email-overview"
md_url: "https://www.compdf.com/guides/generation-sdk/dotnet-core/generation/email-overview.md"
description: "ComPDF SDK Guides. In this developer's guide, all the details and how to use ComPDF for SDK Guides will be covered in depth."
---

# Overview

ComPDF Generation SDK can convert EML and Outlook MSG emails to HTML and PDF. The conversion has two stages:

```
Email (EML/MSG) ──parse──▶ Conversion result (CEmailResult) ──output──▶ PDF
                                   │
                                   ├── GetHtml / ExportHtml: HTML and an offline HTML directory
                                   ├── Resources, attachments and diagnostics
                                   └── WritePdf: write the PDF (can be called repeatedly)
```

-   **One-step conversion**: `CEmailConverter.ConvertToPdf` writes the PDF directly. The returned result also keeps the HTML, resources and diagnostics.
-   **Two-step conversion**: First get a conversion result with `CEmailConverter.ConvertToHtml`, then export the HTML, read attachments or write the PDF as needed. This suits scenarios where the same email needs both an HTML preview and a PDF.

Supported email formats:

| Format | Description |
| --- | --- |
| `CEmailFormat.EMAIL_FORMAT_AUTO` (default) | Detected automatically: a file starting with the CFB compound document signature is parsed as MSG, anything else as EML. The file extension is not used |
| `CEmailFormat.EMAIL_FORMAT_EML` | RFC 5322 / MIME email |
| `CEmailFormat.EMAIL_FORMAT_MSG` | Outlook MSG email, with HTML, RTF and plain text bodies |

Writing a PDF requires an initialized license. Converting to HTML and exporting HTML do not.

The email conversion classes (`CEmailConverter`, `CEmailResult`, `CEmailOptions` and others) are in the `ComPDF.PDFGeneration.EmailToPdf` namespace, and `CConverterProperties` and the other page setting classes are in the `ComPDF.PDFGeneration` namespace. Add the following before use:

```csharp
using ComPDF.PDFGeneration;
using ComPDF.PDFGeneration.EmailToPdf;
```
