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.
In reply to Re: Sending email via Gmail
by wind
in thread Sending email via Gmail
by Gangabass
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |