I would like to export selected emails from my Gmail account to a text file. How can I do this with the Gmail web interface or some other (Linux) option?
I'm not sure that you can do this directly in Gmail. However, you could either selectively forward emails to an alternative account OR download your Gmail using POP3 to the Mozilla Thunderbird email client (which is available under Linux).
If you are filtering more than a handful of emails it would be easier to download your emails en masse using POP3 and use the filtering capabilities of Thunderbird.
Thunderbird supports many add-ons. The ImportExportTools add-on for instance appears to do what you are after, allowing the export of emails to single or multiple text files (there are no doubt others).
Thanks to @Tschareck for clarifying that Gmail filters do not allow you to forward emails already received.
1Forwarding with filters unfortunately works only with emails, that are received after filter was created., but can always FW manually. Apr 14, 2012 at 22:15
@Tschareck That's not quite true. When you create a filter, there is an additional checkbox at the end that enables you to "Also apply filter to # matching conversations." (the default is unchecked).– MrWhiteApr 14, 2012 at 22:23
2Yes, you can apply it, and it will work for labeling or starring, but not for forwarding. Unless something changed in new GMail. Apr 14, 2012 at 22:29
Ah yes, you are absolutely correct! Thanks for the clarification.– MrWhiteApr 14, 2012 at 22:35
You can apply a label to the emails you want to export.
Then in https://www.google.com/settings/takeout/custom/gmail :
- Click 'Select labels' and choose the label you applied.
- Click 'CREATE ARCHIVE'
2I was very excited to learn about the Goggle Takeout option. I just tried it as part of the process to export select emails (emails that had a specific label) within Gmail, and it worked like a charm. I didn't get to try the Thunderbird option, but it certainly is a great second alternative.– user92419May 3, 2015 at 4:09
11this should be the selected answer. Mar 1, 2016 at 14:05
3This exports files to MBOX format, so after export you will need to figure out how to convert from that to your preferred format. Feb 13, 2018 at 0:47
Nice!!!! This was the solution for me! Jul 18, 2018 at 2:05
This still worked great in 2019! And it's worth noting that there's an option near the top of the Step 1 box to "Deselect all" product data types (so you don't also download data from Maps, Calendars, etc., if you don't need it). Depending on the age and usage of your Google account, this may significantly reduce the archive size, and speed up the process overall.– kaygeMar 5, 2019 at 18:51
Found the answer here https://webapps.stackexchange.com/a/21639/19021
It is the command-line tool Got-your-back.
Authenticates with your gmail account to download results of any search query of your email to
I just downloaded 4 years of receipts from a vendor I use with this:
gyb --email firstname.lastname@example.org --search "widgets inc" --local-folder ~/foo
You need to be able to install this command-line tool, which requires python. Very good documentation on the site.
Technically this is not a web app.
Select the emails you want to download, right click, and select "forward as attachment". This will make a new email with all selected e-mails as ".eml" file attachments. Send that yourself and download attached files. From Google support page: https://support.google.com/mail/answer/9337672?hl=en
Use the Save Emails and Attachments Chrome extension:
With that extension you can save Gmail emails as PDFs to Google Drive. Read full instructions here.
You can convert PDFs to text a few different ways. Here's one.
There are 3 different ways to export emails from Gmail:
- Using Google Takeout. Google has greatly improved its tool to take data out of its platform. With the current version of Google Takeout (2023), you can export all your Gmail emails or just those marked with one of your labels.
- Using Gmail "Download email as PDF" feature. That's a feature as old as Gmail, but you can always download an email to PDF. It works also for threads. But it's very limited as you can't export a batch of emails.
- Using a third-party tool. As Gmail doesn't offer a native solution, some developers have filled the gap and made available tools to export emails from Gmail. I'll name two: Mailmeteor for Gmail and cloudHQ. Mailmeteor has the advantage of exporting your emails to a CSV file which you can use in Excel or Google Sheets easily.
As your request is to export "selected emails to a text file", I'll recommend Mailmeteor. You can install it from the Chrome Webstore.