NAME

Mail::Template - Manages templatified emails for sending through Mail::Sender

SYNOPSYS

use Mail::Template;

my $mailer = new Mail::Template((notify_from=>'me\@domain.org'));

$mailer->send_template_email($recipient, $message)
    or die "Could not send mail to recipient: $?\n";

DESCRIPTION

Mail::Template provides an interface for generating emails from templates using Template-Toolkit and sending them through Mail::Sender.

METHODS

new()

Creates a new object. The %args is used to set the default operational parameters:

smtp - The name of the smtp mail server to send mail notices to. Defaults to 'smtp'.

notify_from - The email address that messages sent by this instance of Mail::Template should be addressed as From. Defaults to the environment variables USER@HOST

send_template_email(\%recipient, \%message, \%vars)

Provides a wrapperized interface around Mail::Sender and
Template::Toolkit so you can manage and send templatified
emails flexibly and easily.  Its routines use hashes for
the data objects to make it simpler for interfacing with
other application objects and subsystems.

recipient has the following fields:
   email - required
   name - optional

message has the following fields:
   subject - required
   file - pathname of a file to include as an attachment in email
  Any one of the following is required:
   body - optional
   body_template - optional
   body_template_filename - optional

vars is a user-definable set of variables sent directly to 
  template toolkit when processing the body_template

PREREQUISITES

Template-Toolkit

Mail::Sender

BUGS

None known.

VERSION

0.31

SEE ALSO

perl(1), Template-Toolkit , Mail::Sender

AUTHOR

Bryce Harrington <brycehar@bryceharrington.com>

http://www.osdl.org/

COPYRIGHT

Copyright (C) 2003 Bryce Harrington. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

REVISION

Revision: $Revision: 1.6 $