Test::S...::Mailer(3)
π Test::Smoke::Mailer β the manual page, but make it cute
okay so bestie, this is Test::S...::Mailer(3) β a User Contributed Perl Documentation page, and honestly? it's giving "tiny wrapper, huge responsibility." π let's get into it.
β¨ NAME β¨
Test::Smoke::Mailer β it's literally a Factory for objects to send the report. no cap. it makes mailer objects and they send the report. that's the whole gig. π
π¦ SYNOPSIS π¦
here's the vibe in code form, copy it exactly bestie:
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;
see how it's not scary?? you build it, you call mail, and if mail comes back false you die with $mailer->error. main character error handling. periodt. π₯
πΈ DESCRIPTION πΈ
so this little wrapper is lowkey a diplomat β it still allows you to use the sendmail, sendemail, mail or mailx programs, because sometimes you gotta respect the classics. π
but it prefers to use the Mail::Sendmail module (which comes with this distribution, so it's already in the building π«Ά) to send the reports. it's giving "I'll work with your old faves, but I have a favourite and it's Mail::Sendmail." π
π METHODS π
π Test::Smoke::Mailer->new( $mailer[, %args] )
the heading asks the real question: Can we provide sensible defaults for the mail stuff? yes bestie we can. π
here are the args, exactly as they come:
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!)
quick rundown so you're not out here guessing:
mhowtoβ how we're sending it: aModule::Name, orsendmail, ormail, ormailx, orsendemail. pick your fighter. π₯mserverβ an SMTP server, orlocalhostif you're feeling local. πmbinβ the full path to the mail binary. full path, not vibes. πmtoβ list of addresses, and yes they're comma separated!mfromβ a single address. just one. solo. πmccβ list of addresses, again coma separated! (that's the original spelling, I'm not touching it, it's iconic. π)
π§ Test::Smoke::Mailer->config( $key[, $value] )
config() is an interface to the package lexical %CONFIG, which holds all the default values for the new() arguments. so it's like the settings drawer of this whole operation. ποΈβ¨
and there's a special key, bestie, listen β with the special key all_defaults this returns a reference to a hash holding all the default values. one call, every default, obsessed. π₯
π COPYRIGHT π
okay legal girlies, gather round:
(c) 2002-2013, 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:
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. π so real. no promises, only hope.
π«Ά and that's the whole page, no notes. this was written for perlv5.42.0, dated2025-07-25, from theTest::S...::Mailer(3)page in the User Contributed Perl Documentation. slay, go send that report. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Test-Smoke 1.84-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms