use strict; use warnings; use MIME::Lite::TT; use Data::Dumper; send_email(); sub send_email { my $options = { INCLUDE_PATH => '.' }; my $msg = new MIME::Lite::TT( From => 'me@xyzzy.com', To => 'me@xyzzy.com', Subject => 'test message', Type => 'multipart/mixed', Template => 'template.txt', TmplOptions => $options, TmplParams => {} ); # $msg->attr('content-type' => 'multipart/mixed'); $msg->attach( Type => 'text/plain', Path => 'test.pl', Filename => 'attachment.txt', Disposition => 'attachment' ); $msg->send(); }