lorenzob has asked for the wisdom of the Perl Monks concerning the following question:

Hi all, i'm using MIME::Lite::TT::HTML to send html mail. i got some problem trying to pass to "TmplParams" an array that is content of a file. here is my code:

elsif ($ARGV[0] eq "Errori OMP OVA_LOGGER") { # $mailto = 'some1@somewhere, some2@somewhere, some3@somewhere, +some4@somewhere, some5@somewhere'; $mailto = 'some1@somewhere'; $templ = 'template_errori_omp_ovalogger.html.tt'; open(MYINPUTFILE, "<$data_ovalogger"); my(@lines) = <MYINPUTFILE>; print "@lines\n"; my %params; $params{errori} = \@lines; my %options; $options{INCLUDE_PATH} = '/home/alcatel/.scripts'; $options{INCLUDE_PATH} = '/home/alcatel/.scripts/sendmail'; my $msg = MIME::Lite::TT::HTML->new( From => 'some6@somewhere', To => $mailto, Subject => $ARGV[0], Template => { html => $templ, }, TmplOptions => \%options , TmplParams => \%params , ); $msg->send('smtp', '192.168.16.143', Timeout => 60 ); }

Company email addresses altered by GrandFather

Replies are listed 'Best First'.
Re: MIME::Lite::TT::HTML array as tmplparams
by GrandFather (Saint) on Sep 22, 2010 at 04:11 UTC

    Hard to tell what the problem is that you are experiencing, but the following:

    $options{INCLUDE_PATH} = '/home/alcatel/.scripts'; $options{INCLUDE_PATH} = '/home/alcatel/.scripts/sendmail';

    looks surprising to me. You set a hash value then immediately replace it with a different value.

    True laziness is hard work
Re: MIME::Lite::TT::HTML array as tmplparams
by zwon (Abbot) on Sep 22, 2010 at 02:46 UTC

    First of all, it's not a good idea to post email addresses on public forums (especially other people's addresses).

    You didn't say how this code fails for you. Perhaps it would be better to write small, working example that demonstrates the problem instead of some code fragment which starts from elsif. And you didn't post the template itself.

    How do I post a question effectively?