In June 2014, Google introduced its first API for Gmail. For the first time, users of free Gmail accounts could programmatically manage their Gmail accounts without IMAP. Using the API, you can perform many of the same operations available through the Gmail user interface, e.g.
Full article