I have written a little utility – The Sender’s List – that will help you extract email addresses from your Gmail account. You may extract addresses from every single message in your Gmail mailbox or it can sift through emails that are tagged with a particular label (or folder).
The extracted email addresses are saved in a Google spreadsheet that you may either download as a CSV file or you can use that raw list as an input for Mail Merge. If you looking to create an email marketing campaign for your clients who are not in your Google Contacts but have previously communicated with you, The Sender’s List could be a time-saving option.
To get started, click here to create a copy of the Google Script. Next, put the name of your Gmail folder in cell A2. You may use Inbox for extracting address from mails that are in your Inbox, Starred for just the important emails or All for processing all messages.
Internally, the script pulls email addresses of senders from messages tagged with a particular label and exports them to a Google Sheet. Since the script needs to track messages that have been processed, it applies a new label to these messages and the default name of this label isProcessed. If you wish to use a different name, just replace the value of cell B2.
Now choose the Gmail menu in the Google sheet (see screenshot) and select Initialize. Grant the script access to your Gmail mailbox and then choose RunProgram from the same Gmail menu.
The Google script is now running in the background and, depending on the size of your Gmail folder, may take some time to complete. You may close the Google sheet and it will send you an email once the extraction is complete. The duplicate email addresses will automatically be removed from the final list.
If you wish to extract addresses from another Gmail label, just create a new copy of the blank sheet and repeat the steps. Also, you may choose Gmail->Uninstall to stop the background script from running.