Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

How can I export a list containing e-mail addresses for everyone that has sent me an e-mail? I have all of the messages archived.

share|improve this question
add comment

7 Answers

up vote 5 down vote accepted

I did quite a bit of searching for an app that works at label level and found Gmail Email Exporter from Star Banana.

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.

share|improve this answer
A cheaper alternative for Mac users is Email Contacts Extractor (itunes.apple.com/us/app/email-contacts-extractor/…). Full-disclosure: I developed it myself because I felt other offerings were too expensive or required online access to my email. –  hpique Jul 11 '13 at 9:37
It would be awesome if you could do a version for 20 addresses or fewer, like they do. –  Yar Sep 17 '13 at 22:40
starbanana.com now extracts emails out of the body too, I just tried it and the multi-threading also (does 15 labels at the same time) incredibly fast well impressed. –  Tino Mclaren Nov 9 '13 at 16:41
add comment

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.

function getEmails() {
  // set spreadsheet and retrieve labels
  var ss = SpreadsheetApp.getActiveSpreadsheet();  
  var labels = GmailApp.getUserLabels(), emptyLabels = [];

  // itterate through the labels
  for (var i=0; i<labels.length; i++) {

    try {
      // create sheets and clear content
      var sh = ss.getSheetByName(labels[i].getName()) || 
      ss.insertSheet(labels[i].getName(), ss.getSheets().length);

      // get all messages
      var eMails = GmailApp.getMessagesForThreads(
        GmailApp.search("label:" + labels[i].getName()))
          .reduce(function(a, b) {return a.concat(b);})
          .map(function(eMails) {
        return eMails.getFrom() 

      // sort and filter for unique entries  
      var aEmails = eMails.sort().filter(function(el,j,a)
        {if(j==a.indexOf(el))return 1;return 0});  

      // create 2D-array
      var aUnique = new Array();  
      for(var k in aEmails) {

      // add data to corresponding sheet
      sh.getRange(1, 1, aUnique.length, 1).setValues(aUnique);
    } catch (e) {
   ss.toast("These sheets are empty: " + emptyLabels);

Use the SPLIT function to extract names to find duplicates. System folders are ignored, like INBOX or All Items.

Note: script might take some time to execute, which is of course dependent upon the amount of e-mails

share|improve this answer
I'm getting the following error when running this: TypeError: Reduce of empty array with no initial value. (line 15, file "Code") –  MG1 May 24 '13 at 1:42
@MG1 You might have empty labels. I will check it out –  Jacob Jan Tuinstra May 24 '13 at 7:10
@MG1 checked the script and it fails on empty labels. Revised code so that a message will appear, mentioning the empty labels. –  Jacob Jan Tuinstra Jun 4 '13 at 20:54
The script is awesome! does what it is supposed to do. The sheets are empty toast had me confused, but a refresh of the spreadsheet got me the data I was looking for! Thanks @JacobJanTuinstra –  Moiz Tankiwala Feb 3 at 18:48
This is perfect, and EXACTLY what I needed Thanks @JacobJanTuinstra. –  mrdenny Feb 21 at 3:06
add comment

The only way to do this is

  1. Export all as .txt (see: Export Gmail messages to text or HTML files)
  2. Loop through all of it and grep "From: " lines in a seperate database.

Note: if you use imapsize (free) for step 1 then save the backups as "%FROM - The sender of the email" and you have them in plain sight in your directory.

share|improve this answer
I was afraid of that. Thanks though! –  Brad Dec 2 '10 at 4:00
add comment

The following app is free and works beautifully!


share|improve this answer
Another great utility. But I am yet to try it. –  Moiz Tankiwala Feb 3 at 18:49
add comment
  1. Navigate to the list. Choose the checkbox option dropdown, and select all.
  2. [At the top you will get a hyperlink option to choose all conversations in your list. Click it.] Update: This step doesn't work, it will only let you do 25 at a time, bummer!
  3. Then go under the More dropdown and choose filter messages like these.
  4. In the filter dialogue the From textbox will be highlighted. These are all the from addresses.
  5. Copy it.
  6. Paste it in to an HTML editor like Notepad++ or Visual Studio.
  7. Now you just need to do a search and replace of the word OR, replace with ; or , .
  8. Recopy the list and paste into your message.
share|improve this answer
Better to just give the answer. No need for the story behind it. :-) –  Yosi Mor Aug 16 '13 at 0:07
add comment

MineMyMail fetches all of your messages via IMAP and then extracts the email addresses from it.

You can choose which folders it searches by selecting the "Sent Mail" folder/label.

share|improve this answer
Could you describe in a bit more detail. –  phwd Mar 1 '13 at 19:10
MineMyMail fetches all of your messages via IMAP and then extracts the email addresses from it. You can choose which folders it searches by selecting the "Sent Mail" folder/label. –  Jason Vallery Mar 12 '13 at 19:04
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 Tankiwala Feb 3 at 18:52
add comment

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.

share|improve this answer
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.