#!/usr/bin/perl use strict; use warnings; use MIME::Lite::TT::HTML; my %params; $params{firstname} = 'MyFirstName'; $params{lastname} = 'MyLastName'; my %options; $options{INCLUDE_PATH} = '/path/to/template'; my $msg = MIME::Lite::TT::HTML->new( From => 'email@domain.com', To => 'otheremail@otherdomain.com', Subject => 'Test 1', Timezone => 'UTC', Type => 'multipart/related', Encoding => 'base64', Template => { html => 'template.html', }, Charset => 'utf8', TmplOptions => \%options, TmplParams => \%params, ); $msg->attach( Type => 'text/html', Data => qq{
Here is my image:
},
);
$msg->attach(
Type => 'image/png',
Path => '/path/to/image/image.png',
Id => 'img1',
);
$msg->send(
'smtp',
'smtp.somedomain.com',
Debug => 1,
Timeout => 60,
);