The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-28-2008
thumper thumper is offline
Supporter
 

Join Date: Feb 2005
Posts: 49
Quote:
Originally Posted by KevinADC View Post
Code:
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
Thanks KevinADC
That fixed the problem.
thumper
Reply With Quote