Here is a snippet from my Perl script:
my %params = (
sub_name => $sub_name,
asm_name => $asm_name,
zsm => $zsm,
store => $store,
pin => $pin,
tier => $tier,
avg_weekly_all => $avg_weekly_all,
avg_weekly_br => $avg_weekly_brakes,
expected_sales => $expected_sales,
numOfBays => $numOfBays,
numOfTechs => $numOfTechs,
estimatedJobs => $estimatedBrakeJobs,
brand => $brand,
qty => $qty
);
my %options = (INCLUDE_PATH => '.');
my $msg = MIME::Lite::TT::HTML->new(
From => 'xxx.xxxx@somecompany.com',
To => 'me@somecompany.com',
Subject => "Request (MSG ID: $id)",
Template => { html => 'edge14.html.tt' },
TmplOptions => \%options,
TmplParams => \%params
);
$msg->attr("content-type" => "multipart/mixed");
$msg->attach(
Type => 'text/csv',
Path => 'out.txt',
Filename => "brake_lift_$id" . ".csv",
Disposition => 'attachment'
);
$msg->send or die "Unable to send message: $!";
It is sending the email (with attachment) just fine, but it is not rendering the html content in the body of the email. It is sending as plain text and attaching the html in the format "ATT00001..htm", yes that's TWO dots before 'htm'...
What am I doing wrong??
Answered my own question! Noticed that ALL of the other hash attributes were barewords, so I took the quotes off of "content-type" and it works like a charm!