use strict; use warnings; use Email::Send::SMTP::Gmail; my ($mail,$error)=Email::Send::SMTP::Gmail->new ( -smtp=>'smtp.gmail.com', -login=>'MYGMAILNAME@gmail.com', -pass=>'MYPASSWORD', -port=>587, -layer=> 'tls', -verbose=>1, -debug=>1 );