in reply to Re: Does Email::Simple have "attachment" option?
in thread Does Email::Simple have "attachment" option?

Thank you for the response, but I was looking for a way to to send multiple attachments, it that possible with Email::Stuffer?

  • Comment on Re^2: Does Email::Simple have "attachment" option?

Replies are listed 'Best First'.
Re^3: Does Email::Simple have "attachment" option?
by tobyink (Canon) on Aug 31, 2020 at 07:30 UTC

    Yes, you just call the attach or attach_file methods multiple times.

    use Email::Stuffer; 'Email::Stuffer' ->transport('SMTP', { host => '10.0.0.123' }) ->from('alice@example.net') ->to('bob@example.org') ->subject('Test') ->text_body("This is a test.\n") ->attach_file('wait_its_all_cake.jpeg') ->attach_file('always_has_been.gif') ->send_or_die;
Re^3: Does Email::Simple have "attachment" option?
by Corion (Patriarch) on Aug 31, 2020 at 05:18 UTC

    Most likely, yes, if you handle all the encoding of the body parts yourself.

    Maybe now is a good moment to use MIME::Lite? Despite the claims in its documentation, it still works well and allows for attachments...