Hello ccc ,
Remark out the file opening stuff and just
define : my $contents = "Hello world"; and send a test mail to see if you get Hello world .
I suspect you are getting nothing into $content from the file.
Try with caution to the log.txt's file size :
my $content; # define for strict
open(FILE, "/var/log/log.txt") || die "Cant open file. Reason: $!"; # (-:
while(<FILE>) {
$content .=$_; # get all of the file into content including past new lines
}
close(FILE);
second caution :
The above code will suck the entire file into $contents and memory and try to mail it !
Do not try to mail a file contents that is BIG. (-:
Then continue with your mailing part.
Thanks cornball
Remark out the file opening stuff and just
define : my $contents = "Hello world"; and send a test mail to see if you get Hello world .
I suspect you are getting nothing into $content from the file.
Try with caution to the log.txt's file size :
my $content; # define for strict
open(FILE, "/var/log/log.txt") || die "Cant open file. Reason: $!"; # (-:
while(<FILE>) {
$content .=$_; # get all of the file into content including past new lines
}
close(FILE);
second caution :
The above code will suck the entire file into $contents and memory and try to mail it !
Do not try to mail a file contents that is BIG. (-:
Then continue with your mailing part.
Thanks cornball