However when I add 'attach' to the code, the attachment is sent but the html message is not. When I add TWO attachments only the last is sent, but without the html message (below). Obviously what I am doing is overwriting $msg each time, which I don't want to do. Can anyone show me how to get this done?#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI ':standard'; use MIME::Lite::TT::HTML; my %params; foreach my $name (param( )) { $params{$name} = param($name); } my $host_serv = '/path/host_serv.pdf'; my $prem_serv = '/path/prem_serv.pdf'; my %options; # $options{INCLUDE_PATH} = '/path/to/templates'; my $msg = MIME::Lite::TT::HTML->new( From => 'ex@why.com', To => $params{'emailto'}, Subject => 'Your recent purchase', Template => { html => 'test.html.tt', }, TmplOptions => \%options, TmplParams => \%params, ); $msg->send;
#!/usr/bin/perl -w use strict; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); use CGI ':standard'; use MIME::Lite::TT::HTML; my %params; foreach my $name (param( )) { $params{$name} = param($name); } my $host_serv = '/path/host_serv.pdf'; my $prem_serv = '/path/prem_serv.pdf'; my %options; # $options{INCLUDE_PATH} = '/path/to/templates'; my $msg = MIME::Lite::TT::HTML->new( From => 'ex@why.com', To => $params{'emailto'}, Subject => 'Your recent purchase', Template => { html => 'test.html.tt', }, TmplOptions => \%options, TmplParams => \%params, ); $msg->attach( Type => 'application/pdf', Path => $host_serv, Filename => 'host.pdf', Disposition => 'attachment' ); $msg->attach( Type => 'application/pdf', Path => $prem_serv, Filename => 'guest.pdf', Disposition => 'attachment' ); $msg->send;
In reply to MIME::Lite::TT::HTML problems by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |