This is a way to connect to GMail's atom feed and extract information from it. All you need to do is enter a valid username and password in the corresponding global variables. GMail's atom feed only shows the unread email, but it is a heck of a lot easier to use this than it would be to implement ssl and pop3 to get the full e-mail. Anyway, I split the main part of the script that dealt with GMail into another file and left the example in the main file. Feel free to improve on my simple example