#!/usr/bin/perl use strict; use warnings; use MIME::Lite::TT::HTML; use MIME::Base64; use HTML::Template; 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', Type => 'multipart/mixed', HTMLEncoding => 'base64', Template => { text => 'blanktemplate.html', html => 'template.html', }, TmplOptions => \%options, TmplParams => \%params ); $msg->attach( Type =>'image/png', Path =>'/path/to/image/image.png', Id =>'img1' ); $msg->send('smtp', 'smtp.somedomain.com', Debug=>1, Timeout => 60 );