NAME

CAM::EmailTemplate::SMTP - Net::SMTP based email message sender

SYNOPSIS

use CAM::EmailTemplate::SMTP;

CAM::EmailTemplate::SMTP->setHost("mail.foo.com");
my $template = new CAM::EmailTemplate::SMTP($filename);
$template->setParams(recipient => 'user@foo.com',
                     bar => "baz", kelp => "green");
if ($template->send()) {
   print "Sent.";
} else {
   print "Doh!  " . $template->{sendError};
}

DESCRIPTION

This package is exactly like CAM::EmailTemplate except that it uses the Perl Net::SMTP package to deliver mail instead of a local sendmail executable.

To accomplish this, the programmer must configure the mailhost before attempting to send.

FUNCTIONS

setHost HOST

Create a new template object. The parameters are the same as the CAM::Template constructor.

This can be called as a class method or an instance method. If used as a class method, all subsequent instances use the specified host. If used as an instance method, the host only applies to this one instance.

deliver MSG

Delivers the message. This function assumes that the message is properly formatted.

This method overrides the deliver() method in CAM::EmailTemplate, implementing the Net::SMTP functionality.

AUTHOR

Chris Dolan, Clotho Advanced Media, chris@clotho.com