Log::Dispatch::Email::MailSend - Subclass of Log::Dispatch::Email that uses the Mail::Send module
use Log::Dispatch::Email::MailSend; my $email = Log::Dispatch::Email::MailSend->new ( name => 'email', min_level => 'emerg', to => [ qw( foo@bar.com bar@baz.org ) ], subject => 'Oh no!!!!!!!!!!!', ); $email->log( message => 'Something bad is happening', level => 'emerg' );
This is a subclass of Log::Dispatch::Email that implements the send_email method using the Mail::Send module.
This method takes a hash of parameters. The following options are valid:
This parameter may be a single subroutine reference or an array reference of subroutine references. These callbacks will be called in the order they are given and passed a hash containing the following keys:
( message => $log_message, level => $log_level )
The callbacks are expected to modify the message and then return a
single scalar containing that modified message. These callbacks will
be called when either the log
or log_to
methods are called and
will only be applied to a given message once.
Since Mail::Send
is a subclass of Mail::Mailer
, you can change
how mail is sent from this module by simply use
ing Mail::Mailer
in your code before mail is sent. For example, to send mail via smtp,
you could do:
use Mail::Mailer 'smtp', Server => 'foo.example.com';
For more details, see the Mail::Mailer
docs.
Dave Rolsky, <autarch@urth.org>
Log::Dispatch, Log::Dispatch::ApacheLog, Log::Dispatch::Email, Log::Dispatch::Email::MailSendmail, Log::Dispatch::Email::MIMELite, Log::Dispatch::File, Log::Dispatch::Handle, Log::Dispatch::Output, Log::Dispatch::Screen, Log::Dispatch::Syslog