Chris Faust wrote:

Looking at the docs - would the below work?
my $email_message = HTML::Template->new( filehandle => *FH,
some_loop => [EMAIL PROTECTED],
some_val => $someval,
some_if => 1,
);
&send_email($email_message);

That would certainly work, though I would say this instead:


&send_email( $email_message->output );

Since you're sending the e-mail to a controlled (& homogeneous) list of HTML-receivable e-mail clients, you don't have to worry about a corresponding text version.

I like to use MIME::Lite to send e-mails. Off the top of my head (iow: not tested), the send_email func would look something like this:

sub send_email {
  my ( $message, $mime );
  ( $message ) = @_;

  $mime = MIME::Lite->new(
    To      => '[EMAIL PROTECTED]',
    From    => '[EMAIL PROTECTED]',
    Subject => 'Your Report',
    Data    => $message
  );

  $mime->send;
  # Exercise: Error Handling...
}

Jason



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to