Using Mail::Sender module and printed the log message. See the below code:
#! /usr/bin/perl -w
use Mail::Sendmail;
%mail = ( To => 'xxx@gmail.com',
From => 'yyy@gmail.com',
Message => "This is a very short message"
);
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
The following log message is obtained:
OK. Log says:
Mail::Sendmail v. 0.79_16 - Tue Aug 7 13:27:58 2012
Date: Tue, 7 Aug 2012 13:27:58 +0530
Server: localhost Port: 25
From: xxx@gmail.com
Subject:
To: yyy@gmail.com
Result: 250 2.0.0 q777vw5b026359 Message accepted for delivery
But i dont find any messages in inbox.