use strict; use warnings; use Email::Send::SMTP::Gmail; my ( $email, $error ) = Email::Send::SMTP::Gmail->new( -port => 587, -smtp => 'smtp.gmail.com', -login => 'you@gmail.com', -pass => 'passwordyoucreated' ); die "SMTP connection error: $error" if $email == -1; $email->send( -to => 'you@gmail.com', -subject => 'This is the subject', -body => 'This is the message body', ); $email->bye; __END__