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.
Once (shame on you!)
Twice (shame on me!)
More often than I'd like to be
All the time
Just when answering stupid polls
Who you callin' a fool?
I refuse to vote in this ridiculous poll
Results (474 votes). Check out past polls.