Do you get a subject if you issue the same command at the shell prompt?

But this might probably be more a Unix/Linux question than a Perl question. Not all mail utilities have exactly the same syntax, may be your should check yours.

A possible alternative might be something along these lines (I haven't tested exactly that, but only something similar):

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;
Having said that, it might well be better to use a mail module, such as Mail::Send, Mail::Sendmail or some other (there are many, and I really can't advise one against any other).

In reply to Re^5: Email Question by Laurent_R
in thread Email Question by btobin0

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.