in reply to HTML file or in-memory ?
Instead of printing to the file just append all the output to a scalar and then pass that to MIME::Lite->new() using the Data option rather than Path.
/J\