Test::S...::Mailer(3)

πŸ“¦
version 1.84 Β· 2 versions
, in fedora 43

πŸ’Œ 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: a Module::Name, or sendmail, or mail, or mailx, or sendemail. pick your fighter. πŸ₯Š
  • mserver β€” an SMTP server, or localhost if 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. πŸ”₯


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 perl v5.42.0, dated 2025-07-25, from the Test::S...::Mailer(3) page in the User Contributed Perl Documentation. slay, go send that report. πŸ’Œβœ¨πŸ‘‘
πŸ“¦ where this page comes from