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?

link|improve this question

25% accept rate
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
feedback

12 Answers

up vote 22 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.

link|improve this answer
1  
I really like the flexibility built into IMAPSize. Thanks for the link. – Prestaul Jul 12 '10 at 15:16
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
1  
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
feedback

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

link|improve this answer
16  
The DLF is actually Google... just FYI :) – Nic Wise Oct 9 '10 at 21:30
feedback

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.

link|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
feedback

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

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.

link|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
feedback

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

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.

link|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
feedback

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.

link|improve this answer
feedback

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.

link|improve this answer
feedback

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

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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