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.

I want to be able to export Gmail messages as text or HTML files so that they can be stored, passed around, and easily viewed later.

I would really like to be able to locate a selection of my messages (for example, by tag, by sender, etc.) and export them all at once.

Is there a way to do this?

share|improve this question
    
Here's a link to a post by Matt Cutts on a related topic from a couple of years back. –  Lloyd Dewolf Jul 8 '10 at 5:03

15 Answers 15

up vote 31 down vote accepted

The key is configuring your account to be accessible via IMAP.

I've used IMAPSize to backup GMail accounts. To schedule regular backups on a server I use OfflineIMAP.

Although a quick G search reveals tons of tools/scripts/services to do backup of IMAP servers and especially of GMail.

share|improve this answer
1  
I really like the flexibility built into IMAPSize. Thanks for the link. –  Prestaul Jul 12 '10 at 15:16
3  
be aware IMAP is not good for backups as it syncs both sides, so you delete from one side, it propagates to the other. –  Cawas Oct 5 '10 at 0:53
2  
@Cawas You don't delete when creating a backup. –  Vinko Vrsalovic Oct 5 '10 at 6:10
2  
My bad, Vinko. I was just trying to give a general warning for everyone and @Prestaul. Didn't actually read you were talking about backup - I just assumed the subject was about exporting. Yes, if you backup the IMAP, then you have a backup. I meant IMAP on itself may seem like a backup, but it's not. –  Cawas Oct 5 '10 at 15:45
    
what is the server setting when I am adding a gmail account. Is it www.gmail.com ? –  oneofthelions Aug 8 '12 at 6:48

Consider got-your-back which "is a command line tool that backs up and restores your Gmail account".

You can invoke it like this:

python gyb.py --email foo@bar.com --search "from:pip@pop.com" --folder "mail_from_pip"

After completion you'll find all the emails matching the --search in the specified --folder, along with a sqlite database.

share|improve this answer
    
Awesome! Thanks! For windows users: the command is simply gyb --email foo@bar.com --search "from:pip@pop.com" --folder "mail_from_pip" –  Jules May 21 '13 at 11:51
    
holy molé that is slick... BAM! got my emails –  ted.strauss Apr 15 at 2:07

Gmail has just rolled out a feature allowing users to back up their emails: https://www.google.com/settings/takeout :

enter image description here

Old UI:

enter image description here

share|improve this answer

Import the set of email messages that you want to export in Mozilla Thunderbird by establishing a IMAP link. Install the ImportExportTools add-on and use it to export the messages locally to HTML or EML. The add-on will create a single file for each message as well as an HTML index page that makes it easier to locate specific emails.

share|improve this answer

Best way to save one email , (if its an html mail which is informative and you want to save it for future reference this method works like a charm) , Just open the gmail inbox and beside top right corner you have 2 signs "Printer" and "In new window" (just on the right side of email subject small icons )

  1. Click on "in new window" this will open the mail as a seperate webpage , Now you can either print it or you can save the whole page as picture using a firefox addon (works for IE and Crome also) "Fireshot" , download and install it and press Ctrl+Atl+Shift+Z to save the whole page as an image / pdf

  2. press Ctrl A and select the whole page , Paste the content in either Microsoft Front page or any html editor and save it as a web page. (or paste it in Notepad++ to save it as text)

Regards

share|improve this answer
1  
OP has stated, multiple times, that just saving a single message is not the goal here. –  Al E. Sep 4 '12 at 12:33

backupify.com allows you to export in mbox or json - oh, and it also backs-up your email!

share|improve this answer
    
15 day trial - 3USD per user after –  mplungjan Jun 6 '12 at 14:02

A Google engineering team started an internal 'organization' dedicated to this called the Data Liberation Front. They are working through all the Google products and will continue to update their site as new or improved methods for moving data in and out of their web applications are created.

The DLF sees themselves as being a bit subversive, because a company doesn't usually make it easier for their customers to leave. You can read about how they started and why on their FAQ

share|improve this answer
19  
The DLF is actually Google... just FYI :) –  Nic Wise Oct 9 '10 at 21:30
2  
Few companies make it as easy for the customer to get his/her data as Google does. –  Suzana_K Mar 6 '13 at 23:45

If you just want your email addresses out in a list, I used Gmail email extractor ("GME").

It is not a free product and can be purchased on http://starbanana.com/ (I am not affiliated with them)

It worked for me using my Google Apps account so thought it might help you out.

share|improve this answer

Gmail Keeper does exactly this - it downloads emails from Gmail (via IMAP) and stores them in standard eml format (zipped).

Disclaimer: I wrote this Windows (only) tool, as I couldn't find a suitable one, years ago, when I started felling I should backup my Gmail.

share|improve this answer
    
not free either –  mplungjan Jun 6 '12 at 14:03

I access Gmail with a mail client which stores email in the maildir format. Maildir simply stores each email in its original RFC822 message format in a separate file. These are readable text files, although modern email is often cluttered with base64 encoded mail attachments.

There are multiple gnu/linux email clients which support maildir, including Evolution which is the standard mail client in the Ubuntu distribution. However, there are no Windows email clients supporting maildir that I know of.

share|improve this answer

Similar to @LBushkin's suggestion, use a local POP client, but use Thunderbird. Outlook uses a proprietary format for its local data store.

Emails are saved as plain text files, one file per folder.

share|improve this answer
6  
This is the right answer, except use IMAP so you can pull out all the messages with a specific tag (tags will appear as folders under the [Gmail] folder). Also, if you have a lot of email, turn on the "Advanced IMAP Controls" Labs feature, then, under "Manage Labels", turn off IMAP access for all the folders except the one you want to download. –  Matt Jul 7 '10 at 19:56

I am one of the authors of BackupGoo. We also wanted to have a secure offline copy of our data. BackupGoo is really simple to use and backups all your stuff from Google to your local harddrive in widely-used formats. This includes e.g. GMail, Google Docs, Google Reader. GMail for instance is saved as plain text "Mime-Message" that can be viewed in any text editor or offline email client.

share|improve this answer
    
Do you mean you back up gmail folders in unix mbox format? Might that be very redundant since a given email message may have several labels in gmail? (Perhaps it's not a big deal though.) –  dreeves Oct 6 '10 at 16:19

I have had success using IMAP Tools to backup other (non-Gmail) IMAP accounts. I used both imapdump.pl and IMAPToMbox.pl; they generate one text file per email or one text file per folder, respectively. Both commands allow specifying which IMAP folders (Gmail's tags) you want to back up.

This method suits me well, 'cause I can backup my account automatically (say, a cron job) without my intervention.

share|improve this answer

In Google Labs enable create a document, then go back to the thread you want to export as a document and click 'create a document'.

then in Google documents you can save the resulting document as HTML (zipped) or your can download it as plain text amongst a number of other formats.

share|improve this answer

The easiest way may be to use a local POP client like Outlook to download them. Then you can easily export or save them to text.

For an individual email, you could use Print to print the contents to a file on your machine... but that would get painful quickly for more than a few emails.

share|improve this answer
    
I use Entourage (the Mac version of Outlook), but I don't see a way to export to text or html there either. It will only allow me to export to an "archive"... –  Prestaul Jun 30 '10 at 23:21

protected by Community Oct 23 '13 at 11:38

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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