Converters

How to Open an EML File on Mac

EML is the friendliest email format there is, yet it looks broken in the wrong app.

5 min read

Quick AnswerOpen an EML file on Mac in 3 ways. Use a text editor, a Python script or converter software. Raw headers and an encoded body show in a text editor. Python prints readable headers and attachment names. Converter software moves many EML files into other mail formats. Work on a copy of the file first. Count the messages before and after any conversion.

Saved messages from Windows mail apps, webmail drag outs and archiving tools arrive as EML. Opening one in the wrong app shows a stream of symbols. Below, you will see why the file looks broken and how to open an EML file on Mac with the message readable.

What Is an EML File?

EML stores exactly one message in the Internet Message Format defined by RFC 5322, a plain text header section followed by the body. Attachments and non English text travel as MIME parts, while RFC 2045 defines the base64 and quoted printable encodings those parts use.

Apple Mail saves its own variant as EMLX, which stores one message with extra metadata. Our guide on the EMLX format explains how the two files differ.

Why Does the Message Look Garbled?

Text editors show everything but not in a form you can enjoy. Accented characters appear as sequences like =C3=A9 and attachments appear as long strings of letters. Nothing is damaged. Mail gets encoded for transport and your editor does not decode it.

How Can You Open an EML File on Mac?

RouteWhat you seeBest for
Text editorRaw headers and encoded bodyChecking the file arrived undamaged
Python scriptDecoded headers, body and attachment namesViewing one message quickly
Converter softwareThe mail in another formatMoving many messages into a mail app

Apple Mail also works for a single message. Right click the file, choose Open With and select Mail to open an EML file on Mac in its own window. This route fits one message but not a folder, because Mail cannot open EML files in bulk and handles each file separately.

How Does Python Open EML Files?

Who it suits. Technical users who work in Terminal. Source file size limit. None in the script. Extra application. Python 3 installed on your Mac.

Python’s email package parses the message and decodes the encodings for you. Save the script as view_eml.py and enter python3 view_eml.py message.eml in Terminal.

import sys
from email import policy
from email.parser import BytesParser

with open(sys.argv[1], "rb") as f:
    msg = BytesParser(policy=policy.default).parse(f)

for name in ("From", "To", "Date", "Subject"):
    print(name, msg[name])

body = msg.get_body(preferencelist=("plain", "html"))
print()
print(body.get_content() if body else "No text body")

for part in msg.iter_attachments():
    print("Attachment", part.get_filename())
Tested on a sample message with an accented subject, a quoted printable body and a PDF attachment. Output showed the decoded subject, the body and the attachment name.

Our script prints the sender, recipient, date, subject and body, then lists attachment names. Nothing gets modified but work on a copy anyway.

Which MacXTools Tool Handles a Folder of EML Files?

Folders of thousands of messages need a different approach. MacXTools EML Converter converts them into other mail formats without a script. Our article on the MBOX format explains the format many people choose, since one MBOX file stores a full folder of messages.

What Do the Headers in an EML File Show?

EML files start with a list of lines like From, To, Date and Subject and these are standard fields from RFC 5322. Other lines record the route a message took and the Content-Type line says how the body is built. Plain messages have one text part. Messages with attachments are multipart messages and every part is marked by a boundary string. Knowing this makes things easier when a message looks strange, because you can open the file in a text editor and see which part contains the body.

What Should You Check Before You Open an EML File?

An EML file from an unknown sender can carry a harmful attachment. Read the sender and subject in the script output before you open any attachment. Check the file size too before you open EML files from unknown senders. A message of a few kilobytes has no attachment while a message of several megabytes holds one or more.

Do not rename the extension from .eml. Renaming it to .txt makes an editor open the file but stops mail apps from recognising it. Copy the file to a working folder so the original stays safe.

Which Problems Affect EML Mail?

  • EML files that open in a browser or an unrelated app need another handler. Right click, choose Open With and choose a mail app or text editor.
  • Accented letters look wrong. Bodies use an encoding the viewer did not decode so use the Python script or a mail app.
  • Attachments are missing. They can be inside the file as encoded text so check the script output for attachment names.
  • Dates look off by hours. Dates contain a time zone offset and viewers show it differently.
  • Images in the body do not appear. Messages can link to images online or embed them as separate parts.

Which Route Suits Your Saved Messages?

Use a text editor when you only need to confirm the message is undamaged or copy a line. Use the script when you want a readable view of a few messages or when you need to check a sender and subject quickly. Use a converter when you have a folder of messages and want them in a mailbox format that your mail app imports. Mixing the routes is normal. Many people inspect one file with the script, then convert the full folder once they know what it contains.

How Do You Handle Many EML Files?

Folders of EML files appear whenever a tool saves every message separately. They are easy to create and awkward to manage, because a mail app has to import them one at a time or in a drag and drop that varies by app. Before you import thousands, count the files and note that number. Test the import with ten EML messages, check they look right, then repeat for larger groups. Our guide on converting EML to MBOX on Mac explains the packing step.

What Steps Open One EML File Safely?

  1. Copy the message so the original remains safe.
  2. Use the script to see the sender, date, subject and attachment names.
  3. Open the file in a text editor if something looks wrong.
  4. Open the attachment in its own app after you check the file type.

Four steps like these describe most one off cases. For many files, count first and convert in groups.

How Do You Check Converted EML Files?

Count the messages you started with and compare the number with the converted result. Open a few of the oldest and a few with attachments. Our article on checking a converted mailbox shows the method.

Common Questions

What Is an EML File?

One email saved as plain text in the Internet Message Format, with the headers, the body and any attachments for a single message.

Can a Text Editor Open an EML File?

Yes, because the format is plain text. Headers and body appear in encoded form so accents and attachments look like symbols.

Why Does an EML File Open in the Wrong App?

macOS picks a default app by file type. Use Open With to choose a mail app or text editor or convert the files.

Are Attachments Stored Inside an EML File?

Yes. They are encoded as text parts inside the same file, which is why a script can list their names.

Why Does My Message Show Strange Characters?

Body text or attachments use base64 or quoted printable encoding for transport. Mail apps and scripts decode them.

How Do I View a Message Without a Mail App?

Use a short Python script with the standard email package. You get the decoded headers, the body and the attachment names.

Sources

Every version, option and date above is taken from these pages and not from memory.

  1. RFC 5322, Internet Message Format IETF
  2. RFC 2045, MIME Part One, on base64 and quoted printable encodings IETF
  3. email.parser, parsing email messages, Python documentation Python Software Foundation