in reply to attachments with MIME::Lite::TT?
And a very simple test.pl to put in /tmp#!/usr/bin/perl BEGIN { $MIME::Lite::VANILLA = 1; } use strict; use warnings; use MIME::Lite::TT; use Data::Dumper::Concise; my $template = <<TEMPLATE; This is a template. my name is [% me %]. TEMPLATE my %params = (name => '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";
|
|---|