ksm1010 has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to add two files (that are open as output files in script) to an email, both files needs to be added as message body. But with following code i get first file added as body but the second file is being sent out as attachment. Any Ideas?

my $msg = MIME::Lite->new( From => 'abc.localdomain', To => 'abc@xyz.com', Subject => "Status", Type => 'multipart/mixed'); $msg->attach(Type => 'text/plain', Path => $OutputFileName, ReadNow => 1); $msg->attach(Type => 'text/plain', Path => $OutputFileName2, ReadNow => 1 ); $msg->send();

Replies are listed 'Best First'.
Re: Unable to add second text file as email body
by neilwatson (Priest) on Jun 25, 2014 at 22:49 UTC

    I think a body can only be one file. You'd have to combine the files first then turn the result into a body.

    Neil Watson
    watson-wilson.ca