Email: GmAtom Ve Bailovity (contact me)
This class can be used to access Gmail mailboxes.
It establish an SSL connection to the Gmail Web servers, authenticates as a given user, and retrieves XML Atom feeds with lists of messages stored in the specified mailbox.
It can retrieve new mail messages on a single or multiple Gmail mailboxes. It can check all messages in inbox folder or just those flagged with a given label.
The retrieved message details are returned as arrays and may be sorted by any supported message property value.