Shubham Dixit, email migration and data file expert

Written by Jennifer Walsh. Reviewed for technical accuracy by Shubham Dixit, Independent Expert in Email Forensics and Data File Conversion.

Shubham is an independent external reviewer and not an employee of PCDOTS.

Quick answer. Phone numbers do not sit in an EML file’s headers the way email addresses do, they hide in the message body and signatures. So extracting them means scanning that text for number patterns, which is quick but imperfect. For a few files you copy them by hand, and for a folder a script or a tool matches the numbers, dedupes, and lets you review the list.

Where the numbers hide?

This is the part that makes phone numbers trickier than email addresses. Addresses sit in tidy header lines at the top of an EML, the From, To and Cc fields, so they are easy to read out. Phone numbers have no such field. They turn up in the body of the message and, most often, in the signature at the bottom, written however the sender chose to write them.

So pulling phone numbers out of your EML files means reading through the message text, not a fixed header, and picking out anything shaped like a number. That is easy for a person with a few emails, and for a folder full you hand it to a pattern matcher, a small script or a tool. Either way you finish by removing duplicates and giving the list a quick check.

From: [email protected]To: [email protected]headers, no number Hi team, thanks for the update.Let us talk it through soon. Anna LeeMobile: +1 (555) 123-4567signature block Picked from the signature+1 (555) 123-4567 numbers live in the body, not a field

Addresses are in the headers, numbers are down in the body and signature.

“With email addresses you know exactly where to look, the headers. Phone numbers are the opposite, they are buried in free text and signatures in whatever format the sender liked. That means you are pattern-matching, and pattern-matching always has edges, a date or an order number can look like a phone number, and an oddly spaced one can slip past. So I treat the extracted list as a draft, dedupe it and give it a quick eye before I trust it.” Shubham Dixit, Email Forensics reviewer (draft, pending approval)

By hand, for a few files

If you have only a few EML files, reading them is the simplest route and it costs nothing. Thunderbird opens EML directly, or any free EML viewer will show the message.

Open each email, scroll to the signature and scan the body, and copy any phone numbers into a text file or spreadsheet. It is quick for a handful of messages, and you are reading the numbers in context, so you already know they are real.

With a script, for a folder

For a whole folder, and if you are happy with a little code, a short script is the free way to do it in bulk. EML is plain text, so the body is easy to read.

In Python, the built in email module gives you each message’s body, and a regular expression matches number-shaped strings such as +1 (555) 123-4567 or 555.123.4567. Loop over the folder, collect the matches, drop duplicates with a set, and write a CSV. Expect a few stray matches to clean up, since not everything number shaped is a phone number, but it handles thousands of files in one pass.

Matching is fuzzy, so review

This is the honest part any guide should tell you. Because phone numbers are matched by pattern, not read from a labelled field, the result is not perfect. Numbers come in many shapes, local, international, with extensions, with dots or spaces or brackets, so a matcher casts a wide net. That net sometimes catches things that are not phone numbers, an order reference, a date, a long ID, and it can miss one written in an unusual way.

None of that makes the method unreliable, it just means the last step is a quick review. Dedupe the list, glance down it, and drop the few entries that clearly are not numbers. A minute of checking turns a rough pull into a list you can trust.

Many shapes, matched then checked formats a matcher catches+1 (555) 123-4567555.123.4567+44 20 7946 00005551234567 Reviewdrop a stray dateor order number,dedupe repeats Clean listreal numbers,no duplicates

A wide net catches the formats, a quick review makes the list trustworthy.

In bulk, an extractor

If you have a lot of EML and would rather not script, an extractor does the scanning for you. It reads a folder of EML, finds the phone numbers in the message text, and saves them to a list. The PCDOTS EML Converter loads EML files or a whole folder and its Extract Phone Numbers option pulls the numbers from the messages, then writes them to a text list you can open in a spreadsheet. It runs on Windows and does not need Thunderbird or Outlook. A free version handles the first ten items per folder so you can test it first. As with any pattern-based extraction, give the finished list a quick review.

1Run itOn Windows,open the menu 2Add EMLFiles or awhole folder 3Pick phoneNumbers fromthe Export menu 4SaveThe list toa folder iScans the message text across the folder and saves the numbers as a list.

The tool route, for a folder of EML without any scripting.

Here are the steps with the screens.

Step 1. Install and run the software on Windows, then open the menu.

Run the EML phone number extractor

Step 2. Choose Email Data Files, EML, and add your files or folder.

Select the EML files or folder

Step 3. Open Export and choose Phone Numbers.

Choose the extract phone numbers option

Step 4. Choose a folder on your computer and Save the list.

Save the extracted phone number list

For the same job with addresses see our guide to extract email addresses from EML files, and for related tasks, extract phone numbers from Outlook and extract attachments from EML files.

Free Download
Buy Now

The methods compared

Match the route to how many EML files you have and whether you code.

Method Best for Good to know
Read in Thunderbird A few files, free Numbers seen in context, no false hits
A short script A folder, free, if you code Regex over the body, review the matches
EML extractor tool Bulk, no scripting Windows, saves a list, review after

Frequently asked questions

Where are phone numbers stored in an EML file?
Not in the headers. They appear in the message body and the signature, written in whatever format the sender used, so extracting them means scanning that text.

Can I extract phone numbers from EML files for free?
Yes. For a few files, open them in Thunderbird and copy the numbers. For a folder, a short Python script reads the body and matches the numbers with a regular expression.

Will the extraction catch every number?
Almost, but not perfectly. Pattern matching casts a wide net across many formats, so it can pick up the odd non-number or miss an unusual one. A quick review of the list handles that.

How do I extract from hundreds of EML files at once?
Use a script over the folder, or an extractor tool that scans every message, finds the numbers, and saves one list for you to review.

Are duplicates removed?
They should be. The same number repeats across a signature-heavy archive, so dedupe to unique numbers. A script uses a set, and the tool dedupes for you.

Does extracting change my EML files?
No. Every method here only reads the files and copies the numbers out. The original EML files are left untouched.

From here, your numbers are a list you can use

Once you know phone numbers live in the body and signatures rather than a header, the job is clear, read the text, match the numbers, dedupe, and give the result a quick look. A few files you handle by eye in Thunderbird, a folder you hand to a short script, and a large batch you point the extractor at and let it save the list. From there the numbers are yours to work with, drop them into a spreadsheet, tidy them into your contacts, or load them into a CRM, and the archive you already had becomes a usable directory.

Shubham Dixit

Reviewed by Shubham Dixit

Independent Expert in Email Forensics and Data File Conversion. Shubham reviewed this guide for technical accuracy. He is an independent external reviewer and not an employee of PCDOTS.

Profile  |  LinkedIn