NAME
Test::Smoke::Mailer - Wrapper to send the report.
SYNOPSIS
use Test::Smoke::Mailer;
my %args = ( mhowto => 'smtp', mserver => 'smtp.your.domain' );
my $mailer = Test::Smoke::Mailer->new( $ddir, %args );
$mailer->mail or die "Problem in mailing: " . $mailer->error;
DESCRIPTION
This little wrapper still allows you to use the sendmail, sendemail, mail or mailx programs, but prefers to use the Mail::Sendmail module (which comes with this distribution) to send the reports.
METHODS
- Test::Smoke::Mailer->new( $mailer[, %args] )
-
Can we provide sensible defaults for the mail stuff?
mhowto => [Module::Name|sendmail|mail|mailx|sendemail] mserver => an SMTP server || localhost mbin => the full path to the mail binary mto => list of addresses (comma separated!) mfrom => single address mcc => list of addresses (coma separated!)
- $mailer->fetch_report( )
-
fetch_report()
reads mktest.rpt from{ddir}
and return the subject line for the mail-message. - $mailer->error( )
-
error()
returns the value of$mailer->{error}
. - $self->_get_cc( $subject )
-
_get_cc()
implements the--ccp5p_onfail
option. It looks at the subject to see if the smoke FAILed and then adds the perl5-porters mailing-list to theCc:
field unless it is already part ofTo:
orCc:
.The new behaviour is to only return
Cc:
on fail. This is determined by the new global regex kept in$Test::Smoke::Mailer::NOCC_RE
. - Test::Smoke::Mailer->config( $key[, $value] )
-
config()
is an interface to the package lexical%CONFIG
, which holds all the default values for thenew()
arguments.With the special key all_defaults this returns a reference to a hash holding all the default values.
Test::Smoke::Mailer::Sendmail
This handles sending the message by piping it to the sendmail program.
- Test::Smoke::Mailer::Sendmail->new( %args )
-
Keys for
%args
:* ddir * sendmailbin * to * from * cc * v
- $mailer->mail( )
-
mail()
sets up a header and body and pipes them to the sendmail program.
Test::Smoke::Mailer::Mail_X
This handles sending the message with either the mail or mailx program.
- Test::Smoke::Mailer::Mail_X->new( %args )
-
Keys for
%args
:* ddir * mailbin/mailxbin * to * cc * v
- $mailer->mail( )
-
mail()
sets up the commandline and body and pipes it to either the mail or the mailx program.
Test::Smoke::Mailer::SendEmail
This handles sending the message with the sendEmail program.
- Test::Smoke::Mailer::SendEmail->new( %args )
-
Keys for
%args
:* ddir * mserver * muser * mpass * sendemailbin * to * from * cc * v
- $mailer->mail( )
-
mail()
sets up the commandline and body and passes it to the sendemail program.
Test::Smoke::Mailer::Mail_Sendmail
This handles sending the message using the Mail::Sendmail module.
- Test::Smoke::Mailer::Mail_Sendmail->new( %args )
-
Keys for
%args
:* ddir * mserver * to * from * cc * v
- $mailer->mail( )
-
mail()
sets up the message to be send by Mail::Sendmail.
Test::Smoke::Mailer::MIME_Lite
This handles sending the message using the MIME::Lite module.
- Test::Smoke::Mailer::MIME_Lite->new( %args )
-
Keys for
%args
:* ddir * mserver * to * from * cc * v
- $mailer->mail( )
-
mail()
sets up the message to be send by MIME::Lite.
COPYRIGHT
(c) 2002-2003, All rights reserved.
* Abe Timmerman <abeltje@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See:
* <http://www.perl.com/perl/misc/Artistic.html>,
* <http://www.gnu.org/copyleft/gpl.html>
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.