for my $file (@files) { my $att_part = MIME::Lite::->new( 'Type' => 'application/octet-stream', 'Encoding' => 'base64', 'Path' => $file, ); $msg->attach($att_part); };