Looks to me like you're pretty close to getting it. You can finish by moving that block of "logic" (programmers usually call it code) up above the call to MIME::Lite->new(). Now where you want the output from this block to go, put a variable like $data_table. Then all you need to do is figure out how to accumulate rows into $data_table and you're done. Give it a try and post again if you run into problems.

Once you have it working, you might consider taking the next step and putting all that gnarly HTML into a template, perhaps using HTML::Template. Then you can separate the Perl code in your program from the HTML presentation in the email and when the graphic designer complains that you didn't get the font spacing just right you can tell them to fix it themselves!

-sam


In reply to Re: HTML Email Help! by samtregar
in thread HTML Email 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.