Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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);

Comment on MIME::Lite::TT::HTML and attachments
Select or Download Code
Replies are listed 'Best First'.
Re: MIME::Lite::TT::HTML and attachments
by kcott (Canon) 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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-29 11:33 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (750 votes), past polls