kazak has asked for the wisdom of the Perl Monks concerning the following question:
Here is the piece of code and attachment list format:
Attachment list may look like this: summary.csv,weekly.csv,john.csv
my @files = split /,/,$Attachment; foreach (@files) { chomp; my $f_name = $_; $f_name =~ s/\/root\/Helpers/reports\///; print "FILENAME:$f_name\n"; my @parts = ( Email::MIME->create( attributes => { filename => "$f_name", content_type => "application/x-7z-compressed", disposition => "attachment", encoding => "base64", name => "$f_name", }, body => io( $_ )->all, ), ); $email = Email::MIME->create( header_str => [ From => 'reporter@example.com' ], parts => [ @parts ], header_str => [ To => $To ], header_str => [ Subject => $Report_name ], ); $email->filname_set($f_name); $email->name_set($f_name); my $eml = $email->as_string; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Email::Mime 1 email + multiple attachments
by Eliya (Vicar) on May 20, 2012 at 17:13 UTC | |
by kazak (Beadle) on May 20, 2012 at 18:08 UTC | |
by Eliya (Vicar) on May 20, 2012 at 18:22 UTC | |
by kazak (Beadle) on May 20, 2012 at 18:30 UTC |