#!/usr/bin/env perl use strict; use warnings; use MIME::Lite::TT::HTML; my %params; $params{umlaut} = 'fööbär'; #Encode::_utf8_on($params{umlaut}); my %options= ( INCLUDE_PATH => '.', ENCODING => 'UTF-8', ); my $msg = MIME::Lite::TT::HTML->new( From => 'admin@example.com', To => 'frank@example.com', Subject => 'Your recent purchase', Template => { text => 'revsys.txt.tt', html => 'revsys.html.tt', }, Charset => 'utf8', Encoding => '8bit', TmplOptions => \%options, TmplParams => \%params, ); binmode STDOUT, ':utf8'; print "Should be: ", $params{umlaut},$/; print '-' x 79,$/; print $msg->as_string; #### Should be: fööbär ------------------------------------------------------------------------------- Content-Transfer-Encoding: binary Content-Type: multipart/alternative; boundary="_----------=_158081178855330" MIME-Version: 1.0 X-Mailer: MIME::Lite 3.031 (F2.85; T2.17; A2.21; B3.15; Q3.13) Subject: =?UTF8?B?WW91ciByZWNlbnQgcHVyY2hhc2U=?= Date: Tue, 4 Feb 2020 10:23:08 +0000 From: admin@example.com To: frank@example.com This is a multi-part message in MIME format. --_----------=_158081178855330 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf8 text: fööbär --_----------=_158081178855330 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/html; charset=utf8

fööbär

--_----------=_158081178855330--