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 -->
  #2 (permalink)  
Old 01-28-2008
KevinADC KevinADC is offline
Registered User
 

Join Date: Jan 2008
Posts: 338
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
Reply With Quote