Log::Agent::Driver::Mail - email driver for Log::Agent
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);
This driver maps the logxxx() calls to email messages. Each call generates a separate email message. The Mail::Mailer module is required.
The OPTIONS argument is a hash with the following keys:
An optional prefix for the message body.
The destination addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
The reply-to addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
The source address, must be a scalar containing a valid email address.
The subject line of the email message.
The carbon copy addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
The blind carbon copy addresses, may be a scalar containing a valid email address or a reference to an array of addresses.
The priority level for the email message. This is NOT related to the logging priority.
A reference to an array containing the optional arguments to Mail::Mailer->new(). Generally, this can be omitted.
Thanks to Shirley Wang for the idea for this module.
Mark Rogaski <mrogaski@pobox.com>
Copyright (C) 2002 Mark Rogaski; all rights reserved.
See Log::Agent(3) or the README file included with the distribution for license information.
Mail::Mailer, Log::Agent::Driver(3), Log::Agent(3).
To install Log::Agent, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Agent
CPAN shell
perl -MCPAN -e shell install Log::Agent
For more information on module installation, please visit the detailed CPAN module installation guide.