NAME

Email::Sender::Server::Client - Email Delivery Agent

VERSION

version 0.18

SYNOPSIS

# sending email is simple

use Email::Sender::Server::Client 'mail';

my @message = (to => '...', subject => '...', body => '...');

push @message, 'path', '/path/to/parent/folder'; # where ess is running

my ($m, $id) = mail @message;

unless ($id) {
    
    die $m->errors_to_string;
    
}

or using an object-oriented approach ....

use Email::Sender::Server::Client;

my $client = Email::Sender::Server::Client->new;

my @message = (to => '...', subject => '...', body => '...');

my $id = $client->send(@message);

if ($client->error_count) {
    
    print $client->errors_to_string;
    
}

altering or using a non-sendmail transport ...

use Email::Sender::Server::Client;

my $client = Email::Sender::Server::Client->new;

my @message = (to => '...', subject => '...', body => '...');

push @message, 'transport' => {

    # key is the Email::Sender transport driver,
    # value is the transport driver's arguments
    
    STMP => {
        
        host => '...',
        port => '...',
        
    }

};

$client->send(@message);

if ($client->error_count) {
    
    print $client->errors_to_string;
    
}

Please see the Email::Sender::Server::Message class for attributes that can be used as arguments to the mail() and send() methods.

Currently all ESS classes operate out of the current-working-directory which can be sub-optimal, especially when used in other classes that can be utilized by various different scripts.

The ESS_DATA environment variable can be set to change the path of the .ess directory utilized by the current program, otherwise you may use the path parameter. When changing the path to the .ess directory, please specify a path to the parent directory and not the .ess directory itself.

use Email::Sender::Server::Client 'mail';

my $m = mail (
    
    to => '...', from => '...', ...
    path => '/path/to/parent/folder',
    
);

DESCRIPTION

Email::Sender::Server::Client provides an interface to a non-blocking email delivery agent which queues emails for later delivery.

Email::Sender::Server::Client wraps functionality provided by Email::Sender::Server::Message.

AUTHOR

Al Newkirk <awncorp@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2012 by awncorp.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.