Title: Using sendmail to deliver formatted data in body.

Hello Out There:

Was wondering if anyone can tell me if I can use sendmail to email a formatted text file as the body of an email.  I have a foreach loop that gathers data and puts it into a report format.  I was thinking of calling a subroutine to email the data.  Is there a better way to do this?


{

open (SOMEFILE, ">>SENDIT")   || die "Can't open output file\n";  
format SOMEFILE =                                                 
                                                                       
   @<<<<<<<<<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<
   $A                           $B                   $C

write SOMEFILE;
         
}

sub emailit                                     
{                                               
                                                
open(MAIL, '| /usr/lib/sendmail -t -oi');       
                                                
print MAIL <<EOF;                               
To: somebody                    
Cc: sombodyelse                     
Subject: REPORT
To All see below report:                                         
                                                
"Want report to go here that is formatted"                         
EOF                                             
                                                
close MAIL;                                     
}                                               

Reply via email to