This is the code I am using for sending mail in perl . But I didn't receive mail .
#!/usr/bin/perl
print "Content-type: text/html\n\n";
$to = 'to@gmail.com';
$title='Perl Mail demo';
$from= 'from@gmail.com';
$subject='YOUR SUBJECT';
open(MAIL, "/usr/sbin/sendmail -t");
## Mail Header
print MAIL "To: $to\n";
print MAIL "From: $from\n";
print MAIL "Subject: $subject\n\n";
## Mail Body
print MAIL "This is a test message from Cyberciti.biz! You can write your
mail body text here\n";
close(MAIL);
I am not getting any errors but unable to find the reason why mail is not sending.
Please help me I have tried several examples and forums but nothing works.
This is happening after server migration
I know this question has been asked several times and none of them helped me.