QUICK TIP - How to Save Emails to Google Drive as PDF Files

0 12,510
img_5fc1cc1f498e6 | A&H Business Technology
Related posts

Today, I needed to save some of my Gmail emails to Google Drive as PDF files. I looked around for a bit. I tried CloudHQ, but I didn’t want to pay. Next, I looked into exporting my Google Data into an MBOX type format. This seemed reasonable at first, but then I had to find a tool to import MBOX into. I chose Thunderbird, but then Thunderbird wanted me to pay. Next, I tried a couple of other Chrome Extensions. Neither of these worked well.

Finally, I determined to get the emails to be outputted in the format that I wanted without paying, it was probably best to write a Google App Script.

What’s a Google App Script?

Well, according to Google, “Apps Script is a scripting platform developed by Google for light-weight application development in the G Suite platform.” You can learn more here. If you have a Gmail account, it looks like you should be able to use it.

I started by assigning all of the emails in Gmail that I wanted to export a Label. For the purpose of this tutorial, I created the label “Export”

 

After I created the label “Export”, I next associated the label with the emails that I wanted to save as PDF.

After selecting the emails that I wanted to export. I logged into the Google App Scripts by typing this url, https://script.google.com/. Once in Google App Scripts, I created a new project entitled Save Gmail to Google Drive. I had to give Google App Scripts access to both my Gmail and Google Drive.

Gmail to Google Drive App Script Project

I double-clicked on the project and entered the following javascript code.

Now to format the date use the following bit of code

Next, run the code in Google App Scripts by hitting the play button.

Execute Google App Script Project to save Gmails to Google Drive as PDF
Execute Google App Script Project to save Gmails to Google Drive as PDF

 

Navigate to your Google Drive My Gmail Folder. Voila! You’ll see your pdfs. This code will also handle attachments, which include calendar event types. Ping me if you have any issues, and I can share the script with you.

 

Export Emails to Google Drive as PDF
Export Emails to Google Drive as PDF

TinyURL for this post: https://tinyurl.com/y5ym38uv

Sorry, The Comment Form Is Temporarily Closed At This Time
You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Language:English