Tell me more ×
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

5 Answers

up vote 2 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

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

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(); 

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

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

    // 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) {
      aUnique.push([aEmails[k]]);
    }

    // add data to corresponding sheet
    sh.getRange(1, 1, aUnique.length, 1).setValues(aUnique);
  }
}

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

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
4  
Could you describe in a bit more detail. – phwd Mar 1 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 at 19:04

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

Your Answer

 
discard

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.