CAM-EmailTemplate-SMTP
view release on metacpan or search on metacpan
or
perl Build.PL
perl Build
perl Build test
perl Build install
To get the full effect of testing, please specify a recipient email
address and mailhost:
setenv RECIPIENT user@foo.com
setenv MAILHOST mail.foo.com
To take advantage of Net::SMTP's debugging capabilities, use this:
setenv SMTPTemplate_Debug 1
DESCRIPTION
This module alters the CAM::EmailTemplate mail delivery mechanism to
use raw SMTP delivery (via Net::SMTP) instead of relying on the
sendmail binary program. This module is useful for machines which are
not configured to do their own mail delivery. Instead, the programmer
or user specifies a mail server to use as the delivery agent.
BEGIN
{
use Test::More tests => 3;
use_ok("CAM::EmailTemplate::SMTP");
}
SKIP: {
if ((!$ENV{RECIPIENT}) || (!$ENV{MAILHOST}))
{
skip("\nUse 'setenv RECIPIENT user\@somehost.foo.com' and\n" .
" 'setenv MAILHOST mail.foo.com' to enable this test.\n" .
"You might want to do 'setenv SMTPTemplate_Debug 1' too.", 2);
}
my $t = CAM::EmailTemplate::SMTP->new();
ok($t, "Constructor");
$t->setHost($ENV{MAILHOST});
$t->setString(<<'EOF'
To: ::RECIPIENT::, "Joe Smith" <::RECIPIENT::>
From: "EmailTemplate SMTP test" <justatest@clotho.com>
( run in 0.368 second using v1.01-cache-2.11-cpan-3989ada0592 )