NAME
Test::Health::Email - Moo class to send an e-mail with an attachment through SMTP
SYNOPSIS
See health_check.pl script.
DESCRIPTION
This class is a wrapper for Email::Stuffer and Email::Sender::Transport::SMTP.
ATTRIBUTES
host
A string describing the full qualified name of the SMTP server to be used.
It is optional and defaults to "localhost".
to
A string representing the adressee of the e-mail.
This is a required attribute during object creation.
from
A string representing the sender to the e-mail.
This is a required attribute during object creation.
METHODS
get_to
Getter for to
attribute.
get_from
Getter for from
attribute.
get_host
Getter for host
attribute.
send_email
Sends the e-mail through SMTP.
Expects the following positional parameters:
A string representing the test name.
The full pathname to the report attachment.
A string representing the application (name) that is being tested.
By default, it will try to remove the attachment after the e-mail was send, unless an exception occurs. It will print an error message to STDERR in case of failure to remove the file.
_create_transport
"Hidden" method. Creates an instance of Email::Sender::Transport::SMTP.
SEE ALSO
AUTHOR
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2016 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This file is part of Test-Health distribution.
Test-Health is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Test-Health is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Test-Health. If not, see <http://www.gnu.org/licenses/>.