Sample code for 30+ languages & platforms
Perl

GMail SMTP/IMAP/POP Examples for Chilkat2 Perl