.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Log::Dispatch::Email 3" .TH Log::Dispatch::Email 3 2026-04-13 "perl v5.42.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& package Log::Dispatch::Email::MySender; \& \& use Log::Dispatch::Email; \& use base qw( Log::Dispatch::Email ); \& \& sub send_email { \& my $self = shift; \& my %p = @_; \& \& # Send email somehow. Message is in $p{message} \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module should be used as a base class to implement Log::Dispatch::* objects that send their log messages via email. Implementing a subclass simply requires the code shown in the "SYNOPSIS" with a real implementation of the \&\f(CWsend_email()\fR method. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" The constructor takes the following parameters in addition to the standard parameters documented in Log::Dispatch::Output: .IP \(bu 4 subject ($) .Sp The subject of the email messages which are sent. Defaults to "$0: log email" .IP \(bu 4 to ($ or \e@) .Sp Either a string or a list reference of strings containing email addresses. Required. .IP \(bu 4 from ($) .Sp A string containing an email address. This is optional and may not work with all mail sending methods. .IP \(bu 4 buffered (0 or 1) .Sp This determines whether the object sends one email per message it is given or whether it stores them up and sends them all at once. The default is to buffer messages. .SH METHODS .IX Header "METHODS" This class provides the following methods: .ie n .SS $email\->send_email(%p) .el .SS \f(CW$email\fP\->send_email(%p) .IX Subsection "$email->send_email(%p)" This is the method that must be subclassed. For now the only parameter in the hash is \*(Aqmessage\*(Aq. .ie n .SS $email\->flush .el .SS \f(CW$email\fP\->flush .IX Subsection "$email->flush" If the object is buffered, then this method will call the \f(CWsend_email()\fR method to send the contents of the buffer and then clear the buffer. .ie n .SS $email\->DESTROY .el .SS \f(CW$email\fP\->DESTROY .IX Subsection "$email->DESTROY" On destruction, the object will call \f(CWflush()\fR to send any pending email.