Agent:...r::Mail(3pm)

πŸ“¦
version 1.005 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Agent:...r::Mail β€” the perl manpage, bestie edition

okay so bestie, we're looking at Agent:...r::Mail(3pm), which lives in the User Contributed Perl Documentation section of your perl manual. Sit down, hydrate, and let's get into it 🫢


✨ NAME ✨

Log::Agent::Driver::Mail β€” it's the email driver for Log::Agent. That's it, that's the whole vibe. πŸ“§πŸ’…


🌸 SYNOPSIS 🌸

Here's the whole thing, verbatim, no notes:

use Log::Agent;
require Log::Agent::Driver::Mail;

my $driver = Log::Agent::Driver::Mail->make(
    -to      => 'oncall@example.org',
    -cc      => [ qw( noc@example.org admin@example,net ) ],
    -subject => "ALERT! ALERT!",
    -mailer  => [ 'smtp', Server => 'mail.example.net' ]
);
logconfig(-driver => $driver);

yes the admin@example,net is a comma, and yes we are preserving it exactly, because that's what the source says and we don't rewrite other people's addresses here 🫑


πŸ¦‹ DESCRIPTION πŸ¦‹

So what does this driver do, bestie? It takes all your logxxx() calls and maps them to email messages. Every single call gets its own separate email message. Not batched. Not bundled. One call, one email, every time. πŸ’Œ

⚠️ heads up: the Mail::Mailer module is required. You can't run this without it, fr fr. No Mail::Mailer, no mail, no slay.

πŸŽ€ CONSTRUCTOR πŸŽ€

🌈 make OPTIONS

The OPTIONS argument is a hash with the following keys:

  • -prefix β€” an optional prefix for the message body. Cute little intro for your email, if you want one. ✨
  • -to β€” the destination addresses. This can be a scalar holding one valid email address, or a reference to an array of addresses. Your call. πŸ’–
  • -reply_to β€” the reply-to addresses. Same deal as above: a scalar with one valid email address, or an array reference with many. πŸ“¬
  • -from β€” the source address. This one must be a scalar containing a valid email address β€” no array refs allowed here, bestie, it's a one-address situation. 🫢
  • -subject β€” the subject line of the email message. Make it iconic. πŸ‘‘
  • -cc β€” the carbon copy addresses. Scalar with one valid email address, or a reference to an array of addresses. πŸ“‹
  • -bcc β€” the blind carbon copy addresses. Scalar with one valid email address, or a reference to an array of addresses. 🀫
  • -priority β€” the priority level for the email message. 🚨 And listen: this is NOT related to the logging priority. Different thing entirely. Don't mix them up.
  • -mailer β€” a reference to an array containing the optional arguments to Mail::Mailer->new(). Generally you can just omit this one. lowkey optional, highkey handy when it's not. ✨

πŸ’Œ NOTES πŸ’Œ

Thanks to Shirley Wang for the idea for this module. shoutout 🫢✨


πŸ‘‘ AUTHOR πŸ‘‘

Mark Rogaski <mrogaski@pobox.com> β€” the icon, the legend. πŸ’…


πŸ“œ LICENSE πŸ“œ

Copyright (C) 2002 Mark Rogaski; all rights reserved.

See Log::Agent(3) or the README file included with the distribution for license information. (go read it bestie, it's right there πŸ“–)


πŸ”₯ SEE ALSO πŸ”₯


and that's the page, bestie πŸ’œ no cap, you now know everything there is to know. This was perl v5.36.0 from 2022-10-15 β€” literally the source of the whole vibe. go log something and mail it, you main character πŸŒˆπŸ¦‹πŸ’–

πŸ“¦ where this page comes from