Featured

Download emails from Gmail as CSV file – PHP

February 6, 2015 by Sarath DR in Featured, Internet with 0 Comments

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.

https://console.developers.google.com

Screen Shot 2015 02 06 at 00.08.26 253x300 Download emails from Gmail as CSV file   PHP

Step 2: Download the sample code from below link and add your client ID and secret key.

https://code.google.com/p/google-mail-oauth2-tools/wiki/PhpSampleCode

I have also made some customization in the above code to download it as CSV. You either download that code from the below link.

https://github.com/sarathdr/gmailtocsv

The code comes with a Zend Imap module to read the files. To read more click the below link.

http://framework.zend.com/manual/1.12/en/zend.mail.read.html

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.

http://gmailtocsv.sarathdr.com/

You have to specify the email again and folder name (label name eg: inbox ) to get the emails as CSV.

Tagged , ,

Share this to

Related Posts

Leave a reply

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

*

About
View Sarath D R's profile on LinkedIn

I am a technology consultant and an entrepreneur focused on the following technologies Java,Spring, Android, Angular, Asterisk, Symfony, Cake , Code-Igniter, Jquery , XAMPP, XHTML, AJAX, MySql, Seo, Web Design, Wordpress, iPhone development.

Today’s Tips
  • Generate Codova.jar file from Phonegap project using ant
  • Google map javascript client  to find the geographic co-ordinates  from  Address or post code
  • Update Android main UI from Webview – Phonegap Plugin
  • Jplayer is not working  with HTC One Android 4.3 version browser
  • Regular expression to validate mobile phone numbers starting with + ( plus ) – php
  • Simple pagination script for PHP
  • Useful adb ( Android Debug Bridge ) commands
  • Change the javascript files url to absolute url – Symfony 1.4
  • Set Http authentication header from Client – PHP / CURL

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.This site also uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.

Close