Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Trouble with sending more than one attachment

by AnomalousMonk (Archbishop)
on Oct 18, 2020 at 18:15 UTC ( [id://11122986]=note: print w/replies, xml ) Need Help??


in reply to Trouble with sending more than one attachment

Further to Corion's post:   In the OPed code, in the statement

$att_part = MIME::Lite::->new( 'Type' => 'application/octet-stream', 'Encoding' => 'base64', 'Path' => shift @files, );
the shift @files expression takes only one file path, the first, from the @files array for attachment.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^2: Trouble with sending more than one attachment
by ytjPerl (Scribe) on Oct 19, 2020 at 18:56 UTC
    Got it. Do you have any idea of how to attach more than one? Thanks
      you need to loop over each file.
      $att_part = MIME::Lite::->new( 'Type' => 'application/octet-stream', 'Encoding' => 'base64', 'Path' => shift @files, ); $msg->attach($html_part); $msg->attach($att_part); # assuming all files are same type and encoding, for my $file(@files) { $msg->attach( 'Type' => ......, 'Encoding' => ......, 'Path' => $file, ); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11122986]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-26 06:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found