sub mail_report {
$Mailer = '/usr/sbin/sendmail joe@somewhere.net';
open MAIL,"|$Mailer";
print MAIL "Subject: $X connection attempt \n";
open MESSAGE, "<$outdir$X";
print MESSAGE '$outdir$X\n';
close MESSAGE;
close MAIL;
} #End sub mail_report
where I would like to insert text from a file as the body of the message at the line
print MESSAGE '$outdir$X\n';
The message is received OK however the text is not inserted into the body of the message.
Could someone point out the error of my ways?
Thanks
sub mail_report {
$Mailer = '/usr/sbin/sendmail joe@somewhere.net';
open MAIL,"|$Mailer";
print MAIL "Subject: $X connection attempt \n\n";#two newlines after subject
open(MESSAGE, "<", "$outdir$X") or die "$!";
print MAIL <MESSAGE>;
close MESSAGE;
close MAIL;
} #End sub mail_report
some mails servers and mail clients will reject emails with no "from" header