#!/usr/bin/perl use warnings; use Email::Send; use Email::Send::Gmail; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ From => 'aabc@gmail.com', To => 'abc@Gmail.com', Subject => 'Server down', ], body => 'The server is down. Start panicing.', ); my $sender = Email::Send->new( { mailer => 'Gmail', mailer_args => [ username => 'aabc@gmail.com', password => '1234qwerty', ] } ); eval { $sender->send($email) }; die "Error sending email: $@" if $@;