The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Email::Send::TheSchwartz - Send Messages using TheSchwartz

SYNOPSIS

    use Email::Send;

    my $mailer = Email::Send->new({ mailer => 'TheSchwartz' });
    $mailer->mailer_args([ databases => [ ... ] ]);
    $mailer->send($message);

DESCRIPTION

This mailer for Email::Send uses TheSchwartz to send a message via the Schwartz reliable messaging system. The first invocation of send requires arguments used to initialize a new TheSchwartz object (a list of databases). Subsequent calls will remember the the first setting until it is reset.

This module is only half of the solution to sending email via TheSchwartz; all this module does is insert email jobs into the database. The other half of the solution comes in TheSchwartz::Worker::SendEmail, a worker class for pulling jobs from the queue in the database, and connecting to the remote servers to send the messages.

All return values from this package are true or false. If false, sending has failed. If true, send succeeded. The return values are Return::Value objects, however, and contain more information on just what went wrong.

A successful return value also contains more information: it contains a handle for the job that was inserted into the database (a TheSchwartz::JobHandle object). It can be accessed like this:

    my $return = $mailer->send($message);
    if ($return) {
        my $handle = $return->prop('handle');
        ...
    }

For more information on these return values, see Return::Value.

LICENSE

Email::Send::TheSchwartz is free software; you may redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR & COPYRIGHT

Except where otherwise noted, Email::Send::TheSchwartz is Copyright 2007 Six Apart, cpan@sixapart.com. All rights reserved.