
Test::Smoke::Mailer - Wrapper to send the report.

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;

This little wrapper still allows you to use the sendmail, mail or mailx programs, but prefers to use the Mail::Sendmail module (which comes with this distribution) to send the reports.

Can we provide sensible defaults for the mail stuff?
mhowto => [Module::Name|sendmail|mail|mailx]
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!)
fetch_report() reads mktest.rpt from {ddir} and return the subject line for the mail-message.
error() returns the value of $mailer->{error}.
_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 the Cc: field unless it is already part of To: or Cc:.
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.
config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments.
With the special key all_defaults this returns a reference to a hash holding all the default values.

This handles sending the message by piping it to the sendmail program.
Keys for %args:
* ddir * sendmailbin * to * from * cc * v
mail() sets up a header and body and pipes them to the sendmail program.

This handles sending the message with either the mail or mailx program.
Keys for %args:
* ddir * mailbin/mailxbin * to * cc * v
mail() sets up the commandline and body and pipes it to either the mail or the mailx program.

This handles sending the message using the Mail::Sendmail module.
Keys for %args:
* ddir * mserver * to * from * cc * v
mail() sets up the message to be send by Mail::Sendmail.

This handles sending the message using the MIME::Lite module.
Keys for %args:
* ddir * mserver * to * from * cc * v
mail() sets up the message to be send by MIME::Lite.

(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.