---
title: "Convert EML and MSG files to PDF with Document Engine"
canonical_url: "https://www.nutrient.io/guides/document-engine/file-management/convert-email-files/"
md_url: "https://www.nutrient.io/guides/document-engine/file-management/convert-email-files.md"
last_updated: "2026-06-05T20:16:40.130Z"
description: "Learn how to convert EML and MSG email files to PDF with Document Engine, including how to control header language and timezone formatting."
---

# Convert email files to PDF

Document Engine supports converting email files such as `EML` and `MSG` to PDF. As of Document Engine 1.16.0, you can also control the language and timezone used when rendering email headers and timestamps.

## Email conversion options

When you convert an email file through the [Build API](https://www.nutrient.io/api/reference/document-engine/upstream/#model/Part), you can set these file-part options. These options are supported only for email files (`EML` and `MSG`):

- `email_language` — A BCP 47 language tag used for translated email header labels and date/time formatting.

- `email_timezone` — An IANA timezone name used for rendering email timestamps.

If you omit these options:

- `email_language` defaults to `en-US`

- `email_timezone` defaults to `UTC`

## Example: Convert an email with default English formatting

```json

{
  "parts": [
    {
      "file": "email",
      "email_language": "en-US",
      "email_timezone": "UTC"
    }
  ]
}

```

This renders labels such as `From`, `To`, and `Subject`, and it formats timestamps in UTC.

## Example: Convert an email with German formatting

```json

{
  "parts": [
    {
      "file": "email",
      "email_language": "de-DE",
      "email_timezone": "Europe/Prague"
    }
  ]
}

```

This renders labels such as `Von`, `An`, and `Betreff`, and it formats timestamps using the Prague timezone.

## Example request

Use the email file as a normal Build API file part and add the email-specific options:

### SHELL

```shell

curl -X POST http://localhost:5000/api/build \
  -H "Authorization: Token token=<API token>" \
  -F email=@/path/to/example.eml \
  -F instructions='{
  "parts": [
    {
      "file": "email",
      "email_language": "de-DE",
      "email_timezone": "Europe/Prague"
    }
  ]
}' \
  -o result.pdf

```

### HTTP

```http

POST /api/build HTTP/1.1
Content-Type: multipart/form-data; boundary=customboundary
Authorization: Token token=<API token>

--customboundary
Content-Disposition: form-data; name="email"; filename="example.eml"
Content-Type: message/rfc822

<email data>
--customboundary
Content-Disposition: form-data; name="instructions"
Content-Type: application/json

{
  "parts": [
    {
      "file": "email",
      "email_language": "de-DE",
      "email_timezone": "Europe/Prague"
    }
  ]
}
--customboundary--

```

For supported email file types, refer to the [file type support](https://www.nutrient.io/guides/document-engine/about/file-type-support.md) guide.
---

## Related pages

- [Create a document from a URL](/guides/document-engine/file-management/create-a-document-from-url.md)
- [Create a document from an upload](/guides/document-engine/file-management/create-a-document-from-upload.md)
- [Working with password-protected PDFs](/guides/document-engine/file-management/password-pdfs.md)
- [File management overview](/guides/document-engine/file-management.md)
- [List documents with pagination](/guides/document-engine/file-management/list-documents.md)
- [Remove files](/guides/document-engine/file-management/remove.md)
- [Store user-uploaded files](/guides/document-engine/file-management/store-user-uploaded-files.md)

