Exception::Reporter::Sender::Email - a report sender that sends detailed dumps via email
version 0.012
my $sender = Exception::Reporter::Sender::Email->new({ from => 'root', to => 'Beloved SysAdmins <sysadmins@example.com>', });
This is the only report sender you'll probably ever need.
It turns the report into a multipart email message and sends it via email.
Each set of summaries is turned into a MIME message part. If a dumpable has become more than one summary, its summaries will be children of a multipart/related part. Otherwise, its summary will become a part of the kind indicated in the summary.
multipart/related
The ident of the first summary will be used for the subject of the message.
ident
The GUID of the exception report (the thing returned by the reporter's report_exception method) is used as the local part of the email message's Message-ID.
report_exception
Every reported message has a In-Reply-To header formed by combining a slightly-munged version of the ident and the reporter. This means that similar exception report emails will thread together in a thread-capable email reader.
reporter
$email_reporter->send_report(\@summaries, \%arg, \%internal_arg);
This method builds a multipart email message from the given summaries and sends it.
%arg is the same set of arguments given to Exception::Reporter's report_exception method. Arguments that will have an effect include:
%arg
extra_rcpts - an arrayref of extra envelope recipients reporter - the name of the program reporting the exception handled - if true, the reported exception was handled and the user saw a simple error message; sets X-Exception-Handled header and adds a text part at the beginning of the report, calling out the "handled" status"
%internal_arg contains data produced by the Exception::Reporter using this object. It includes the guid of the report and the caller calling the reporter.
%internal_arg
guid
caller
The mail is sent with the send_email method, which can be replaced in a subclass.
send_email
The return value of send_report is not defined.
send_report
$sender->send_email($email, \%env);
This method expects an email object (such as can be handled by Email::Sender) and a a hashref that will have these two keys:
from - an envelope sender to - an arrayref of envelope recipients
It sends the email. It should not throw an exception on failure. The default implementation uses Email::Sender. If the email injection fails, a warning is issued.
Ricardo Signes <rjbs@cpan.org>
This software is copyright (c) 2010 by Ricardo Signes.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Exception::Reporter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Exception::Reporter
CPAN shell
perl -MCPAN -e shell install Exception::Reporter
For more information on module installation, please visit the detailed CPAN module installation guide.