App::MonM::Notifier::Channel::Email - monotifier email channel
Version 1.00
use App::MonM::Notifier::Channel; # Create channel object my $channel = new App::MonM::Notifier::Channel( timeout => 300, # Default: 300 ); # Send message via email channel $channel->email( { id => 1, to => "anonymous\@example.com", from => "root\@example.com", subject => "Test message", message => "Content of the message", headers => { "X-Foo" => "Extended eXtra value", }, }, { encoding => 'base64', # Default: 8bit content_type => undef, # Default: text/plain charset => undef, # Default: utf-8 # SMTP options host => '127.0.0.1', # Default: localhost port => 25, # Default: 25 # General options timeout => 120, # Default: 120 helo => 'host.example.com', # Default: undef # SASL & SSL options #username => '', # Default: undef #password => '', # Default: undef ssl => 0, # Default: undef ssl_options => {}, # Default: undef }) or warn( $channel->error ); # See error print $channel->error unless $channel->status; # Also see trace for error details print $channel->trace unless $channel->status;
This module provides "email" method.
my $status = $channel->email( $data, $options );
The $data structure (hashref) describes body of message, the $options structure (hashref) describes parameters of the connection via external modules
It is a structure (hash), that can contain the following fields:
Contains internal ID of the message. This ID is converted to an X-Id header
EMail address of the recipient
EMail address of the sender
Subject of the message
Body of the message
Optional field. Contains eXtra headers (extension headers). For example:
headers => { "bcc" => "bcc\@example.com", "X-Mailer" => "My mailer", }
Encoding: 'quoted-printable', base64' or '8bit'
Default: 8bit
See Email::MIME
The content type
Default: text/plain
Part of common Content-Type attribute. Defines charset
Default: utf-8
SMTP option "host". Contains hostname or IP of remote SMTP server
Default: localhost
SMTP option "port". Contains port to connect to
Defaults to 25 for non-SSL, 465 for 'ssl', 587 for 'starttls'
Maximum time in secs to wait for server
Default: 120
SMTP attribute. What to say when saying HELO
No default
This is sasl_username SMTP attribute, is optional field.
Contains the username to use for auth
This is sasl_password SMTP attribute, the password to use for auth; required if username is provided
This is ssl SMTP attribute: if 'starttls', use STARTTLS; if 'ssl' (or 1), connect securely; otherwise, no security.
Default: undef
See Email::Sender::Transport::SMTP
This is ssl_options SMTP attribute (hashref): passed to Net::SMTP constructor for 'ssl' connections or to starttls for 'starttls' connections; should contain extra options for IO::Socket::SSL
For internal use only!
Called from base class. Returns initialize structure
Called from base class. Returns status of the operation
See CHANGES file
CHANGES
CTK, Email::MIME, Email::Sender
See TODO file
TODO
* none noted
App::MonM::Notifier, Email::MIME, Email::Sender, Net::SMTP, IO::Socket::SSL, App::MonM::Notifier::Channel
Sergey Lepenkov (Serz Minus) http://www.serzik.com <abalama@cpan.org>
Copyright (C) 1998-2017 D&D Corporation. All Rights Reserved
This program 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.
This program 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.
See LICENSE file
LICENSE
To install App::MonM::Notifier, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::MonM::Notifier
CPAN shell
perl -MCPAN -e shell install App::MonM::Notifier
For more information on module installation, please visit the detailed CPAN module installation guide.