#!/usr/bin/perl BEGIN { $MIME::Lite::VANILLA = 1; } use strict; use warnings; use MIME::Lite::TT; use Data::Dumper::Concise; my $template = < 'me'); my %options = (EVAL_PERL => 1); send_email(); sub send_email { my $msg = MIME::Lite::TT->new( From => 'me@xyzzy.com', To => 'me@xyzzy.com', Subject => 'test message', Type => 'multipart/mixed', Template => \$template, TmplOptions => \%options, TmplParams => \%params, ); $msg->attach( Type => 'AUTO', Path => '/tmp/test.pl', Readnow => 1, Filename => 'test.pl', ); $msg->stringify; $msg->print(\*STDOUT); } exit; __END__ #### #!/usr/bin/perl # test.pl use strict; use warnings; print "This is a test. Please standby for instructions\n";