Using Mail::Sender module and printed the log message. See the below code:
#! /usr/bin/perl -w
%mail = ( To => 'firstname.lastname@example.org',
From => 'email@example.com',
Message => "This is a very short message"
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
I think you want to at least read and understand Mail::Sendmail and spend some time learning about how email works. You're using a local mail server, not the gmail platform. I suspect you'll find a bounce in your local mail server explaining why this message hasn't been delivered.