hello follwoing code is sending empty email body. I am trying to send HTML 
content in body of mesg. It works if I use a string instead of array. I tried 
sending reference to @email_body, but It simply printed array_ref in body.

modules used are:

use Email::MIME;
use Email::Sender::Simple qw(sendmail);


open(my $tmp_fh,"<",html_file) or die "error: $!";
    @email_body = <$tmp_fh>;
close $tmp_fh;

    my $message = Email::MIME->create(
      header_str => [
        From    => '<jo...@apple.com>',
        To      => '<jac...@banana.com>',
        Subject => "Please see my test email",
      ],
      attributes => {
        encoding => 'quoted-printable',
        charset  => 'ISO-8859-1',
        content_type => 'text/html'
      },
      body_str => @email_body,
    );

    sendmail($message);

Reply via email to