How to Extract Email Addresses from Gmail Messages

Learn how to extract email addresses and names from email messages in your Gmail account and import the email directory into Google Contacts or Outlook address book

A fintech startup is preparing to host its first-ever networking event for professionals within the industry. Over the course of their journey, the company has engaged in email communication with industry experts, partners, and clients. Now, they aim to collate a directory of these email addresses to send personalized email invitations.

Email List from Gmail

Extract Email Addresses from Gmail

The primary challenge is to extract all these email addresses from the company’s Gmail account and download them in a compatible format, like CSV, that can be easily imported into Google Contacts or a mailing list service like MailChimp.

This is where Email Address Extractor can help. It is a Google add-on that sifts through all email messages in the company’s Gmail account, extracts the email addresses and saves them in a Google Spreadsheet. It works for both Gmail and Google Workspace accounts.

The Gmail address extractor add-on can mine email addresses from specific Gmail folders (labels), emails that have been sent or received in the last n months, or for the entire mailbox.

You can choose to extract email addresses of the sender and the recipient fields, including those in the CC field. Additionally, it can parse the email’s subject line and message body and capture email addresses from the text. This is useful for extracting addresses from, say PayPal invoices, where the buyer’s email addresses are often written in the message body.

How to Extract Email Addresses in Gmail

You may follow the step-by-step guide on how to extract email addresses from Gmail messages using the Email Address Extractor add-on.

  1. Install the Gmail Extractor add-on and grant the necessary permissions. The add-on needs access to Gmail and Google Sheets for saving the extracted email addresses.
  2. Launch the add-on inside your Google Spreadsheet and specify the search criteria. You may use Gmail search operators and any matching emails will be processed by the extractor.
  3. Next, select one or more message fields (to, from, cc, bcc) that should be parsed for extracting emails. The add-on can also pull names of the sender and recipients if they are available inside the email headers.

Gmail Search Criteria

Click on the Save and Run option to extract all the email addresses from the emails that match the specified criteria. The entire process may take some time depending up on the size of your Gmail mailbox.

The extracted email addresses will be stored in the current spreadsheet. You will notice that two sheets have been added to your active Google Sheet.

The first sheet contains the list of all the unique email addresses that have been extracted from the matching emails. The second sheet contains the complete details of the emails that have been processed. These include the message date, the sender’s detail, the subject line and a link to the original email message in Gmail.

Email Address Extractor

The Google sheet should remain open and the computer should be online during the extraction. If the connection is lost, or if the extraction process is interrupted for some reason, you can simply click the “Resume” button and the extractor will pick from where it left off previously, avoiding the need to start the entire process over again.

The add-on applies a label, titled Extracted, to all the emails that have been processed and extracted. If you wish to re-extract the email addresses from the same set of emails, you can do so removing the label from the emails and running the extractor again.

Internally, it is a Google Script that uses the magic of Regular Expressions to pull email addresses from Gmail. The extracted email addresses are saved in a Google spreadsheet that can later be exported to Google Contacts or Outlook.

Amit Agarwal

Amit Agarwal

Google Developer Expert, Google Cloud Champion

Amit Agarwal is a Google Developer Expert in Google Workspace and Google Apps Script. He holds an engineering degree in Computer Science (I.I.T.) and is the first professional blogger in India.

Amit has developed several popular Google add-ons including Mail Merge for Gmail and Document Studio. Read more on Lifehacker and YourStory


Awards & Titles

Digital Inspiration has won several awards since it's launch in 2004.

Google Developer Expert

Google Developer Expert

Google awarded us the Google Developer Expert award recogizing our work in Google Workspace.

ProductHunt Golden Kitty

ProductHunt Golden Kitty

Our Gmail tool won the Lifehack of the Year award at ProductHunt Golden Kitty Awards in 2017.

Microsoft MVP Alumni

Microsoft MVP Alumni

Microsoft awarded us the Most Valuable Professional (MVP) title for 5 years in a row.

Google Cloud Champion

Google Cloud Champion

Google awarded us the Champion Innovator title recognizing our technical skill and expertise.

Email Newsletter

Sign up for our email newsletter to stay up to date.

We will never send any spam emails. Promise.