Email::Sender::Server::Client - Email Delivery Agent
version 1.000001
# sending email is simple use Email::Sender::Server::Client 'email'; my $receipt = email { to => '...', subject => '...', body => '...' }; # ... check on the status of $receipt print "file has been queued" if -f $receipt; print "file has been processed" if ! -f $receipt;
or using an object-oriented approach ....
use Email::Sender::Server::Client; my $client = Email::Sender::Server::Client->new; my $receipt = $client->email({to => '...', subject => '...', body => '...'}); print "file has been queued" if -f $receipt; print "file has been processed" if ! -f $receipt;
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_data (data) directory utilized by the ess program, otherwise you may use the path parameter.
By default, a "ess_data" folder is created for you automatically in the current directory however when changing the path to the ess_data directory, please note that such a change will supercede the defaults and data will be stored at the path you've specified. For continuity, try to use absolute paths only!!!
Email::Sender::Server::Client provides an interface to the ESS non-blocking email delivery system which queues emails for later delivery. This class is a simple wrapper around the Email::Sender::Server::Manager class, the manager is responsible for queuing email messages and delegating tasks to the worker processes.
The email method is designed to provide a simple single method for sending emails to the server. It accepts valid attributes accepted by Email::Sender::Server::Message. It returns a list of two elements, a client object and the filepath of the queued message if the operation was successful.
use Email::Sender::Server::Client 'email'; email { to => '...', subject => '...', body => '...' } or die "Error sending message to ...";
Al Newkirk <anewkirk@ana.io>
This software is copyright (c) 2010 by Al Newkirk.
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 Email::Sender::Server, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::Sender::Server
CPAN shell
perl -MCPAN -e shell install Email::Sender::Server
For more information on module installation, please visit the detailed CPAN module installation guide.