in reply to Sending email via Gmail
Take a look at the cpan modules already made for accessing Gmail.
Specifically there is Email::Send::Gmail which was spin off from Email::Send which you used.
DejaVu Sans Mono
Droid Sans Mono
Envy Code R
Source Code Pro
The default, whatever it is
Results (108 votes). Check out past polls.