# .eml MIME Type: message/rfc822

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

- MIME type: `message/rfc822`
- Extensions: .eml
- Content-Type header: `message/rfc822`
- Compress in transit: yes

## Good to know

- Mail clients open `.eml` files directly. Outlook's own `.msg` format is a different, binary file — see [.msg](https://www.devkult.com/mime/msg.md).
- 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.

## Server configuration

### 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">
```

## FAQ

### 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

- [.msg — application/vnd.ms-outlook](https://www.devkult.com/mime/msg.md)
- [.txt — text/plain](https://www.devkult.com/mime/txt.md)
- [.ics — text/calendar](https://www.devkult.com/mime/ics.md)

Open the interactive page: https://www.devkult.com/mime/eml