Google Script Useful

Export Your Emails From Gmail into Excel or CSV

We receive hundreds of emails in a month in our Gmail. Students receive PDF ebooks, teachers receive meeting requests, job seekers receive offer letters, business men receive orders and proposals, internet guys receive news letters. But all those emails are scattered on their own way. You can not perform any analysis on them. For example, a business man can not calculate how many emails he/she has got from a particular person. You can not even plot any graph/chart on the raw emails. To do so you have to first get those information in an Excel sheet.

To  solve above problem we  have created an app script  which can export your emails to Google spreadsheet. Later you can download that as an Excel. 

Update: If your emails have not been categorized into different labels then you can smoothly use this script, it will work great for you. Otherwise, you can use our updated script which can even export the Gmail-labels into the spreadsheet. You can also export only those emails which are present under a specific label in Gmail.

Comparison among different versions:

Version Title Price Action
1.0 Export emails from Gmail to Excel or CSV $ 8.99
2.0 Export emails from Gmail to Excel or CSV with labels $ 9.99 Visit
3.0 Export emails from Gmail to Excel or CSV with labels & attachments $ 10.99 Visit
4.0 Export all emails from Gmail to Excel or CSV
(With advanced features, recommended for business users)
$38(Offer) Visit

If you still need to ask something urgently, then call us at +919778188086

How to do it

  • First purchase the product from above.
  • Open the Email Exporter Spreadsheet
  • After it loads you can find a "Export Emails" option in the menubar
  • Click on it and you will get two more options (a) Export last N emails (b) Export selected emails
  • Export last N emails needs no explanation. You can export up to last 200 emails.
  • Export selected emails can export only some particular emails.

How to provide the parameters

(a) Export last N emails
After you click this option, it will ask for the number of emails you want to export. You need to provide a number between 1-200. To export more than 200 emails go for Export selected emails option, where you can use Gmail search queries so that you can export unlimited emails in a batch of 200.

(b) Export selected emails
For this option you need to provide a Gmail search query. You can write queries even in the traditional way. For more about Gmail search quries you can refer this page. For Example: To get only those emails from and has attachments, you can write query like: from: has:attachment

After you provide the parameters it will take some seconds to clear the existing entries in the spreadsheet (if any). Then it will start exporting your emails. It will also show you the progress status like how much percentage has been completed.

30 thoughts on “Export Your Emails From Gmail into Excel or CSV”

  1. Everytime I try to use this sheet it just says it experienced an error, even just trying to export that most recent message I received..

    1. Hey chace, I checked it again and it is working perfect for me. Can you tell me exactly when you see the error. Are you executing it from the menubar ?

    1. Thanks for the question. I modified the script as you have mentioned in your question. Now it can export Gmail labels into a separate column in the spreadsheet. It will be really helpful to all. Check it here

      1. Hi Hari. Sorry, only just noticed your update. Fantastic to see you have implemented this. I use gmail as a task manager (using I can now print my task lists. This is very powerful as I can filter I as I would in Gmail to create printable lists. Great work!!

    1. Yes, why not ! But the body will be fetched as HTML. If you are populating the spreadsheet with HTML body, it will be fully cluttered.
      Moreover you can not read HTML messages unless you display it in webpage. If still you want, then go to script editor and add a new column. Very simple 🙂

        1. I found that in the spreadsheet I can use the regexreplace

          = regexreplace(I2,””,””)

          = regexreplace(J2,” “,””)

          How can I place it inside the script?

    2. sheet.getRange(“H”+lastEntry).setValue(messages[j].getBody());

      You gotta go in and change it in 3 places. Basically put column H as getBody and it will export the body of the email

      1. This works great. How can I only get a part of the message, not the whole body? I tried .substring (200,300), but it didn’t work. Any ideas? Thank you!

  2. Hi Hari,
    When I “Export selected emails”, after entering filter criteria, it prompts – “Authorization Required”. I clicks on “OK” but no update after that. Just Blank Page.

  3. It will be good tips to export email from gmail and i know most of the users are like this service and they are try to do this in more time. So thank you so much to give us good lesson.

Leave a Reply

Your email address will not be published. Required fields are marked *