| Carp-Mailer documentation | view source | Contained in the Carp-Mailer distribution. |
Carp::Mailer - Traps die and warn signals and dispatch emails to someone.
Igor Sutton Lopes <igor@izut.com>
Use it to notify someone if an error occurrs in your application.
use Carp::Mailer (
recipients => [qw/igor@izut.com/],
subject => "%s execution had errors! Check it!",
)
Text::Template, Mail::Mailer
Carp::Mailer is an error reporting module. It will trap any warn or
die signals and then dispatch an email to specified recipients the
message the signal threw.
Must be a list reference to all recipients the errors should be sent.
Example
use Carp::Mailer ( recipients => [qw/first@domain.com second@domain.com/], );
The format of the subject the message will have. The placeholder %s will be
substituted by the application's file path.
Example
use Carp::Mailer ( subject => "An error occurred when executing %s"; );
The format of the body the message will have. At this time, it's available only
{$application} and {$message} placeholders.
Example
use Carp::Mailer (
message => 'An error occurred while executing {$application}:\n\n{$message}',
);
The method Mail::Mailer will use to deliver the messages. Check Mail::Mailer documentation to check the available methods.
Example
use Carp::Mailer ( method => 'sendmail', );
This option is used if the method option was set as smtp. It specifies the mail relay server Mail::Mailer will use to deliver the messages.
Example
use Carp::Mailer ( method => 'smtp', relay => 'mail.domain.com', );
| Carp-Mailer documentation | view source | Contained in the Carp-Mailer distribution. |