csharp2a has asked for the wisdom of the Perl Monks concerning the following question:

I want to pass a file containing HTML into the body of an Email::Sender setup. I can pass text between ""'s but I cannot get it to use a file to create the body. How would I accomplish this task? I am sure I am missing something simple.

Replies are listed 'Best First'.
Re: Email::Sender body as HTML from file
by haukex (Archbishop) on Jul 01, 2019 at 16:48 UTC
Re: Email::Sender body as HTML from file
by karlgoethebier (Abbot) on Jul 01, 2019 at 19:30 UTC

    Try Email::Simple / Email::MIME to create a message object and Path::Tiny to read the file.

    Minor Update: Added link to module.

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

Re: Email::Sender body as HTML from file
by Anonymous Monk on Jul 01, 2019 at 22:19 UTC
    Email::Stuffer is a wrapper of Email::MIME and Email::Sender that makes this trivial. Just attach your HTML with ->html_body and send.