devkult_
tools30converters34
home/mime/.eml

.eml MIME type

Email messagedocuments

message/rfc822

A complete email — headers, body and attachments — in the standard internet message format.

MIME typemessage/rfc822
Extensions.eml
Content-Typemessage/rfc822
Compress in transit?Yes — enable gzip or Brotli

Good to know

  • Mail clients open .eml files directly. Outlook's own .msg format is a different, binary file — see .msg.
  • An email forwarded as an attachment is a message/rfc822 part inside the outer multipart/mixed message.
  • Treat uploaded emails like untrusted HTML: never render the body inline on your own origin.

Serve .eml files with the right type

The response header to send:

Content-Type: message/rfc822

Most servers pick the type from the file extension. If yours sends the wrong one, map it explicitly:

nginx (inside the types block in mime.types)
message/rfc822 eml;
Apache (.htaccess or server config)
AddType message/rfc822 .eml
Express
res.set("Content-Type", "message/rfc822");
Python
import mimetypes

mimetypes.add_type("message/rfc822", ".eml")
HTML file input
<input type="file" accept=".eml,message/rfc822">

Check it

See what a server sends for a file, and what type a local file really is by its contents:

curl -sI https://example.com/file.eml | grep -i '^content-type:'
file --mime-type file.eml

Frequently asked questions

What is the MIME type for .eml files?

message/rfc822.

What Content-Type header should a .eml file be served with?

Content-Type: message/rfc822. It compresses well, so let the server apply gzip or Brotli.

Related types

Headers that go with it: Content-Type · Content-Disposition · X-Content-Type-Options