I have written small piece of code to send mail through perl script.Below is the code.I have executed it as #
perl perlmail.pl and the code got executed with no errors.
Still have not received any mail.
Also I have installed Mail::send module from CPAN directly but no luck.
Could any mail please share your views on this?
#!/usr/bin/perl -w
use Mail::Send;
my $msg = new Mail::Send;
my $time = localtime();
$msg->to( 'girdhar.sripathi@gmail.com') || die "mail not sent";
$msg->cc( 'giridhar276@gmail.com');
$msg->subject("Webserver is down! ($time)");
my $fh = $msg->open;
$fh->close;
# complete the message and send it
---------- Post updated at 09:49 PM ---------- Previous update was at 09:46 PM ----------
Also I have tried with the below code still no luck.Code got executed but havnt received any sort of mail.
#!/usr/bin/perl
$path_to_sendmail = '/usr/sbin/sendmail -t';
# this is the usual location of the sendmail program,
# see if your's is somewhere else
open MAIL,"|$path_to_sendmail"; # open a pipe to da program
print MAIL q(From:
giridhar.sripathi@gmail.com
To:
giridhar276@gmail.com
Subject: Whats up?
See, I mailed you through my program.
);
---------- Post updated 07-12-12 at 01:12 AM ---------- Previous update was 07-11-12 at 09:49 PM ----------
any help on this will be highly appreciated.
Regards,
Giridhar