E-mail (.eml) parser API

Parse a raw e-mail (.eml / MIME) into JSON: decoded subject and addresses, text and HTML, latest reply, attachments in base64, Received chain and DKIM.

POSThttps://apibox.io.vn/v1/email-parse
Content & HTML▶ Try it online

Send a raw message (an .eml file, a message/rfc822 body or the source as raw) and get clean JSON: subject and names decoded from RFC 2047 (Vietnamese included), from / to / cc / bcc / reply-to as name + address, date in ISO 8601, message id, in-reply-to and references for threading, the plain text and HTML bodies (quoted-printable, base64 and legacy charsets decoded) and every attachment with its file name, MIME type, size, content id and content in base64.

latest_reply cuts the quoted history from the text ("On … wrote:", Gmail Vietnamese "Vào … đã viết:", Outlook "From: / Sent:" blocks and ">" lines), which is what a ticketing system wants to store. The Received chain is parsed (from, by, protocol, IP, time), Authentication-Results gives the SPF / DKIM / DMARC verdicts written by the receiving server, DKIM-Signature headers give domain and selector, List-Unsubscribe is returned for newsletters.

attachments=meta lists attachments without their content, none skips them; files larger than max_attachment_bytes (default 5 MB) are listed without content. Parsing uses postal-mime (MIT-0), the library recommended for Cloudflare Email Workers. Messages are processed in memory and never stored.

Parameters

NameInTypeRequiredDefault
filebodyfilenoThe .eml file (multipart, raw message/rfc822 body or file_base64).
rawbodystringnoOr the message source as text.
attachmentsbody|querystringnobase64base64, meta (no content) or none.
max_attachment_bytesbody|querynumberno5000000Larger attachments are listed without content.
headersbody|querybooleannotruefalse: leave out the full header list.
no_htmlbody|querybooleannofalseLeave out the HTML body.

Example

curl -X POST "https://apibox.io.vn/v1/email-parse" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: message/rfc822" \
  --data-binary 'From: =?UTF-8?B?Tmd1eeG7hW4gVsSDbiBBbg==?= <an@gmail.com>
To: support@example.vn
Subject: =?UTF-8?Q?H=C3=B3a_=C4=91=C6=A1n_th=C3=A1ng_11?=
Date: Tue, 10 Nov 2026 09:15:00 +0700
Message-ID: <CAF123@mail.gmail.com>
Authentication-Results: mx.example.vn; dkim=pass header.d=gmail.com; spf=pass; dmarc=pass
Content-Type: text/plain; charset=utf-8

Chào anh, em gửi hóa đơn.

Vào Th 2, 9 thg 11, 2026 lúc 10:00 Hỗ trợ <support@example.vn> đã viết:
> Anh gửi giúp hóa đơn nhé
'

Response

{
  "subject": "Hóa đơn tháng 11",
  "from": {
    "name": "Nguyễn Văn An",
    "address": "an@gmail.com"
  },
  "sender": null,
  "reply_to": [],
  "to": [
    {
      "name": null,
      "address": "support@example.vn"
    }
  ],
  "cc": [],
  "bcc": [],
  "date": "2026-11-10T02:15:00.000Z",
  "message_id": "<CAF123@mail.gmail.com>",
  "in_reply_to": null,
  "references": [],
  "return_path": null,
  "delivered_to": null,
  "text": "Chào anh, em gửi hóa đơn.\n\nVào Th 2, 9 thg 11, 2026 lúc 10:00 Hỗ trợ <support@example.vn> đã viết:\n> Anh gửi giúp hóa đơn nhé\n",
  "html": null,
  "latest_reply": "Chào anh, em gửi hóa đơn.",
  "attachment_count": 0,
  "attachments": [],
  "authentication": {
    "results": [
      {
        "dkim": "pass",
        "spf": "pass",
        "dmarc": "pass"
      }
    ],
    "dkim_signatures": [],
    "received_spf": []
  },
  "received": [],
  "list": {
    "unsubscribe": null,
    "unsubscribe_post": null,
    "id": null
  },
  "headers": [
    {
      "key": "from",
      "value": "=?UTF-8?B?Tmd1eeG7hW4gVsSDbiBBbg==?= <an@gmail.com>"
    },
    {
      "…": "…"
    }
  ],
  "note": "Signatures are listed, not verified (DKIM / SPF results are those written by the receiving server). Nothing is stored."
}

Use cases

  • Turn inbound e-mails into helpdesk tickets
  • Extract invoice PDFs and XML attached to supplier e-mails
  • Archive mailboxes as searchable JSON
  • Debug delivery: Received hops, SPF / DKIM / DMARC results

FAQ

Are DKIM signatures verified?

No. The API reports the verdicts the receiving server wrote in Authentication-Results and lists DKIM-Signature domains; use /v1/email-auth to check a domain’s DNS records.

How big can a message be?

Up to the file size of your plan. Attachments over max_attachment_bytes (5 MB by default, 30 MB in total) are listed without content.

Are Outlook .msg files supported?

No, only MIME (.eml). In Outlook, save or forward the message as .eml first.

Related APIs

Start with 1,000 free requests every month. Get free API key →