CAM::EmailTemplate::SMTP - Net::SMTP based email message sender
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.
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}; }
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.
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.
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.
Clotho Advanced Media Inc., cpan@clotho.com
Primary developer: Chris Dolan
To install CAM::EmailTemplate::SMTP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CAM::EmailTemplate::SMTP
CPAN shell
perl -MCPAN -e shell install CAM::EmailTemplate::SMTP
For more information on module installation, please visit the detailed CPAN module installation guide.