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

NAME

Pcore::SMTP - non-blocking SMTP protocol implementation

SYNOPSIS

my $smtp = Pcore::SMTP->new( {
    host     => 'smtp.gmail.com',
    port     => 465,
    username => 'username@gmail.com',
    password => 'password',
    tls      => 1,
} );

# send email with two attachments
$message_body = [ [ 'filename1.ext', \$content1 ], [ 'filename2.ext', \$content2 ] ];

$smtp->sendmail(
    from     => 'from@host',
    reply_to => 'from@host',
    to       => 'to@host',
    cc       => 'cc@host',
    bcc      => 'bcc@host',
    subject  => 'email subject',
    body     => $message_body,
    sub ($res) {
        say $res;

        $cb->();

        return;
    }
);

DESCRIPTION

AnyEvent based SMTP protocol implementation.

ATTRIBUTES

METHODS

new(\%args)

Please, see "SYNOPSIS"

sendmail(%args)

Where %args are:

NOTES

If you are using gmail and get error 534 "Please log in via your web browser", go to https://myaccount.google.com/lesssecureapps and allow less secure apps.

SEE ALSO

http://foundation.zurb.com/emails.html

https://habrahabr.ru/post/317810/

AUTHOR

zdm zdm@softvisio.net

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by zdm.