my $subject = "Mail subject\n"; my $from = 'me@my_company.com\n'; my $cc = "whoever\@my_company.com\n"; open my $MAIL, "|/usr/sbin/sendmail -t" or die "... $!";; # Mail Header print $MAIL "To: addressee\@my_company.com\n"; print $MAIL "Cc: $cc"; print $MAIL "From: $from"; print $MAIL "Subject: $subject\n\n"; # Mail Body print $MAIL "\nThe accompanying message to be sent.\n\n"; my $stat_file = "$result_path/STAT.TXT"; open my $COUNT, "<", $stat_file or die "can't open $stat_file $!"; print $MAIL <$COUNT>; close $COUNT; print $MAIL "\n\n\n"; print $MAIL "Regards, \n"; print $MAIL "sender's signature, \n"; close $MAIL;