NAME
CAM::EmailTemplate::SMTP - Net::SMTP based email message sender
LICENSE
Copyright 2005 Clotho Advanced Media, Inc., <cpan@clotho.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
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.
See README for a comparison with other CPAN modules.
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
Clotho Advanced Media Inc., cpan@clotho.com
Primary developer: Chris Dolan