I don't know if you can do so - But you might want to have a look at the GMAIL APIs
] which are offered by Google.
As others already have suggested - You can! Use the OAuth API
]. Credit for this edit goes to Ranjan.D
Marco Alessandro Bertschi