Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

MIME::Lite::TT::HTML and attachments

by swandown (Novice)
on Jan 29, 2013 at 18:23 UTC ( #1015918=perlquestion: print w/replies, xml ) Need Help??
swandown has asked for the wisdom of the Perl Monks concerning the following question:

Hi - I'm having trouble with attachments while using MIME::Lite::TT::HTML. If I use :

$msg->attr("content-type"  => "multipart/mixed");

The gets preference and my nice is a long scroll down the email away. However, if leave out that attribute assignment the show up first . . . but the attachment isnt there!

Here's my code . . . and thanks :

my %params; $params{param1} = $param1; $params{param2} = $param2; my %options; $options{INCLUDE_PATH} = '/var/www/html/test'; my $msg = MIME::Lite::TT::HTML->new( From => '', To => '', Subject => "Test", Template => { html => '', text => '', }, TmplOptions => \%options, TmplParams => \%params, ); # Set our content type properly $msg->attr("content-type" => "multipart/mixed"); $msg->attach( Type => 'application/msexcel', Path => '/var/www/cgi-bin/test/test.xls', Filename => 'test.xls', Disposition => 'attachment' ); $msg->send('smtp', '', Timeout=>60);

Replies are listed 'Best First'.
Re: MIME::Lite::TT::HTML and attachments
by kcott (Chancellor) on Jan 30, 2013 at 04:53 UTC
      Hi Ken, thanks so much for taking the time to reply. I had however already tried what you've suggested and the behaviour was just the same. For the moment I'm going to send an empty txt template . . . but it's not satisfactory. Cheers, Mark

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015918]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (2)
As of 2018-04-23 21:43 GMT
Find Nodes?
    Voting Booth?