Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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 template.txt.tt gets preference and my nice template.html.tt is a long scroll down the email away. However, if leave out that attribute assignment the template.html.tt 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 => 'me@domain.com', To => 'user@domain.com', Subject => "Test", Template => { html => 'template.html.tt', text => 'template.txt.tt', }, 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', 'smtp.domain.com', Timeout=>60);

Comment on MIME::Lite::TT::HTML and attachments
Select or Download Code
Re: MIME::Lite::TT::HTML and attachments
by kcott (Abbot) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015918]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2015-07-02 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls