Hey, guys!
I've been fussing with this for awhile & thought I'd ask those that know more than me. I've been using MIME::Lite::TT for automating email messages with success, but now need to add a simple text attachment. After poking about the Internet, I've cobbled the following together which sends the attachment correctly, but now I'm losing the text of the message itself:
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(); }
In reply to attachments with MIME::Lite::TT? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |