The email body is not being sent in the email.
As others in this thread have stated there are many reasons
why this could be happening and without amplifying
information there is no way to tell what is going on.
Nevertheless let me forge on with a suggested change
in your strategy:
#!/usr/bin/perl -w
use strict;
use diagnostics;
use warnings;
open(FIN,"< /opt/autotree/autouser/out/chk_cal_date.out")
or die $!;
my $old_ifs=$/; # Lets nullify the IRS.
$/=undef;
my $slurp=<FIN>;
$/=$old_ifs; # Restore the IFS
close FIN;
send_the_mail('you@there.com','a subject',$slurp);
exit(0);
sub send_the_mail {
my($addr,$subject,$body)=@_;
open(PIPE,sprintf("| mailx -s %s %s",$subject,$addr))
or die $!;
print <PIPE> $body;
close PIPE;
}
__END__
Unfortunatly using a mail PM like Mail::Mailer is not an option.
I am mildly curious: why isn't this an option? It would
certainly be a much cleaner approach in my honest opinion...
Hope this helps.
Peter @ Berghold . Net
Sieze the cow! Bite the day!
Test the code? We don't need to test no stinkin' code! All code posted here is as is where is unless otherwise stated.
Brewer of Belgian style Ales
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.