in reply to Mail::Sendmail multiline Message

Without you showing us the (Perl) code, it's hard to tell. I have no problem sending multiline mails with Perl. Have you read Mail::Sendmail?

Replies are listed 'Best First'.
Re^2: Mail::Sendmail multiline Message
by kafkaf55 (Acolyte) on Mar 17, 2010 at 14:03 UTC
    Thanks again, Corion, you have been very helpful.

    use Mail::Sendmail;
    use vars qw(%mail) ;


    %mail = ( To => 'ifasftp@chesterfield.gov',
    From => 'burtonk@chesterfield.gov',
    Subject => 'Test email from Perl',
    Message => "< Many lines here"
    );

    sendmail(%mail) or die $Mail::Sendmail::error;

    I am looking at the "Message" item where I would like to enter many lines like a normal email.
    Ken

      So, what have you tried to put many lines into the parameter for Message? I ask, because the mechanisms that Perl supports are the same that the various shells, and certainly ksh support. Also see perlop on quotes and quote-like operators.

      Also, you could assign all the many lines to a variable and then use that variable as the value:

      my $message_text = "... many lines ..."; ... Message => $message_text, ...
        I will review the perlop and let you know how things go.
        Ken
        I need to expand on my messages. My program needs to write out messages at different times, thus why I write out to a file. When program is finished, I need to mail the results with all the information from the message file. I believe the here document will not work.
        Ken
        In ksh, I am creating lines like:
        echo "This is line1" >> mail_content (file)
        echo "this is line2" >> mail_content

        Then, "mail ..subject.. ip address.. < mail_content"

        I am assuming same process in Perl??
        Ken