The potentially obvious issue is that you have my $mail_body = $template; in place of my $mail_body = $template->output; as documented in HTML::Template. I'm also not sure why you have CGI in there or where you are getting sendmail from (that's not MIME::Lite's interface), but perhaps this is more of what you need (does not run):

#!/usr/bin/perl use strict; use CGI qw(-oldstyle_urls :standard); use CGI::Carp qw(fatalsToBrowser); use Date::Calc qw( Add_Delta_Days Decode_Date_US Today ); use HTML::Template; my $template = HTML::Template->new( filehandle => *DATA); print "<h3>Email Test</h3>"; my $from = 'test@test.com'; my $to_name = 'Test Form'; my @mail_to = ( 'me@test.com' ); my $subject = "TEST TEMP\n\n"; # template parameters my $f_name = "Joe"; my $date = "02/08/2011"; my $acc = "123455667889"; my $company = "Test Company."; $template->param(f_name => $f_name); $template->param(date => $date); $template->param(acc => $acc); $template->param(company => $company); my $mail_body = $template->output; # Corrected sendmail( \@mail_to, $subject, $mail_body, $from, $to_name ); print "\nDONE\n"; __DATA__ <table width=\"100%\" border=\"0\" bgcolor=\"#ffffff\" cellpadding=\"0 +\" cellspacing=\"0\"> <tr> <td width=\"100%\"colspan=\"2\">&nbsp;</td> </tr> <tr> <td width=\"100%\" colspan=\"2\"><b>Test</b></td> </tr> <tr> <td width=\"30%\">&nbsp;</td><td width=\"70%\">&nbsp;</td> </tr> <tr> <td width=\"30%\">Name:</td><td width=\"70%\"><TMPL_VAR NAME=" +f_name">.</td> </tr> <tr> <td width=\"30%\">EDate:</td><td width=\"70%\"><TMPL_VAR NAME= +"date">.</td> </tr> <tr> <td width=\"30%\">Acc:</td><td width=\"70%\"><TMPL_VAR NAME="a +cc">.</td> </tr> <tr> <td width=\"30%\">Company:</td><td width=\"70%\"><TMPL_VAR NAM +E="company">.</td> </tr> </table>

In reply to Re: HTML Template Help! by kennethk
in thread HTML Template Help! by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.