This is a fun project that I did to test Google API. If you follow the simple steps you can simply download emails as CSV from your Google account.
Step 1: Click the below url to open Google console.(sign up if you haven’t an account.) Create Google API authentication credential. Create a new project in the console and create Client ID for application type Web Application.
Step 2: Download the sample code from below link and add your client ID and secret key.
I have also made some customization in the above code to download it as CSV. You either download that code from the below link.
The code comes with a Zend Imap module to read the files. To read more click the below link.
From the below link you can test the functionality. It is just a proof of concept and it is not storing any private data locally. Please comment under the post if you have any questions.
You have to specify the email again and folder name (label name eg: inbox ) to get the emails as CSV.