I find it hard to believe that this question doesn’t exist on SO, but I couldn’t find an instance or one similar for Perl….
Anyway, what Perl module should I use to attach multiple files to an email?
Currently, I’m using this code to send an email with a single attachment, but I couldn’t figure out how to modify it to handle multiple attachments:
my $mail_fh = \*MAIL;
open $mail_fh, "|uuencode $attachment $attachment |mailx -m -s \"$subject\" -r $sender $recipient";
print $mail_fh $message;
close($mail_fh);
Can this code block be modified to handle multiple attachments? Or do I have to use a special module to pull this off? If so, what is the module and how would I script it out?
Thanks for any help!
I ended up going with an example using
MIME::Litefound hereexample usage: