11 Answers
11

I am quite surprised by all the complicated answers implying some extra tools!
Every email you receive has its address added to "All contacts" (as opposed to "My Contacts") in the Contacts part of Gmail.
Export that one and you're done (or I missed something in your question).

That would work great, assuming the person still has access to the Gmail account rather than a simple archive of the messages. Good solution!
– BradDec 29 '14 at 16:12

Yes agreed but there is one caveat to using contacts over extract tools, you may have messed with your contacts, a lot of us do when we 'tidy up' as the OP suggests as his messages are archived. At this point you are now not sure if you have 'all' your email addresses? I was in this situation and having looked at all answers here the starbanana one was quite simply the most elegant and trustworthy (it uses two step auth and app specific passwords) and a direct connection from my PC to gmail so no man in the middle listening.
– Tino MclarenMar 8 '15 at 9:17

This is where the power of Google Apps Script kicks in. If you paste the following script in a new Google Spreadsheet (Tools, Script editor, press the bug icon to authenticate the script), then new sheets will be automatically created based on the number of labels present. After that, the e-mail addresses will be added.

Starbanana has changed their name to deep-email-extractor and it also looks like revamped the App UI and made it work on multiple accounts (discovered having just logged in to my app), changed link below to reflect this.

Original Answer

If you need a fast desktop app (not a script) then consider this.

I did quite a bit of searching for an app that works at label level and found Gmail Email Exporter from deep-email-extractor.

It's a paid app (I have nothing to do with them) but it's cheap and you get to export email addresses from specific labels or all your Gmail account.

So in your case put all your email received into a label using a filter and use the above to export to a CSV file.

Another great utility. But I am yet to try it.
– Moiz TankiwalaFeb 3 '14 at 18:49

1

I would NEVER trust any 'on-line app', so many scams out there steeling un/pw and all your email addresses. Go with Installed app - HTTPS connection.
– Tino MclarenApr 9 '15 at 16:10

I agree you need to be cautious but the guy behind Labnol is a good guy who's published a ton of really helpful stuff. If you don't trust it but are a little technical you can always go and grab the src code which he links to from that article, and roll your own: ctrlq.org/code/…
– RedYetiAug 6 '19 at 11:19

I figured out a way to do this for Mac users using Mac Mail and address book without needing to download extra software. This works with Mac Mail 4.6 and Address Book 5.0.3. Not sure if it works for other vers or not. This may work similarly for other IMAP Email programs like Thunderbird, but I can't vouch for that.

Here are the steps:

Set up your Gmail account in Mac Mail. Make sure the incoming mail server is "imap.gmail.com" You can find this under the toolbar>Mail>Preferences>Accounts.

In Gmail, create a Label for the emails for which you want to extract email addresses.

In Gmail, label all the emails you want per Label above.

In Gmail, go to Settings>Labels and tick off the box for the new Label you created that says "Show in IMAP."

Restart Mac Mail so the new Gmail Label syncs.

Open Address Book. If you use Address Book for your contacts you'll need to back up your contacts because you need to delete all contacts in Address Book. I believe you can do this with File>Export>Address Book Archive. I don't use Address Book other than for exporting Gmail emails so I can't give good advice on this. Delete Address Book contacts at your own risk.

In Address Book, delete all your contacts. You should be able to do this by selecting one contact, pressing Command+a and pressing the delete key.

In Mac Mail, find your IMAP folder. There should be a column on the left side of the window with all your Mailboxes. If not go to the top toolbar, select View>Show Mailboxes or press Command+Shift+M. The IMAP folder will be toward the bottom of the column below "Reminders", "RSS", "On My Mac" etc. You should see the Name of your Gmail account you set up earlier with a dropdown arrow on the left.

In Mac Mail, click the dropdown arrow next to your mailbox. This will show you a list of folders and should show the Label you created in Gmail as a folder. Select this folder by clicking it.

In Mac Mail in the Messages window, which should now display all your emails for you Gmail Label), select all the emails in the list. Go to the top toolbar, select Messages>Add Senders to Address Book or press Shift+Command+Y. All the senders for your Gmail Label should now be in Address Book.

In Address Book you can now export contacts as vCards to use in whatever program you like by going to the toolbar and selecting File>Export>Export vCards. You can even import back into Google Contacts. If you need a CSV file, unfortunately you will need to import the vCards into another program (Google Contacts works) and re-export because you cannot export CSV from Mac Mail.

Hope this helps! It's a bit cumbersome, but works for me and is pretty easy after you do it a couple of times.

Is MineMyMail trustworthy? I went to their site and Chrome warned me that the certificate has expired. Not having a proper HTTPS certificate and asking users to enter their Gmail username and password is definitely scary. It leads me to suspect that the site might extract the emails and use it for their own spamming or selling to other spammers.
– Moiz TankiwalaFeb 3 '14 at 18:52

IMAP Addresses Exporter is a Mac App that connects to any IMAP email account and extracts every sender address, also from folders/label you set previously. In all fairness, I have to highlight that it is developed by my company.