in reply to sending emails with gmail

You'll probably have much better luck using this module: Mail::Webmail::Gmail
It has a fully featured interface to gmail, inclusive of sending and receiving mail.
use Mail::Webmail::Gmail; my $gmail = Mail::Webmail::Gmail->new( username => 'username', password => password', ); $gmail->send_message( to => 'user@domain.com', subject => Test Message +', msgbody => 'This is a test.' );