GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Email::Sender::Transport::SMTP::TLS(3) User Contributed Perl Documentation Email::Sender::Transport::SMTP::TLS(3)

Email::Sender::Transport::SMTP::TLS - Email::Sender with Net::SMTP::TLS (Eg. Gmail)

version 0.15

    use Email::Sender::Simple qw(sendmail);
    use Email::Sender::Transport::SMTP::TLS;
    use Try::Tiny;

    my $transport = Email::Sender::Transport::SMTP::TLS->new(
        host => 'smtp.gmail.com',
        port => 587,
        username => 'username@gmail.com',
        password => 'password',
        helo => 'fayland.org',
    );

    # my $message = Mail::Message->read($rfc822)
    #         || Email::Simple->new($rfc822)
    #         || Mail::Internet->new([split /\n/, $rfc822])
    #         || ...
    #         || $rfc822;
    # read L<Email::Abstract> for more details

    use Email::Simple::Creator; # or other Email::
    my $message = Email::Simple->create(
        header => [
            From    => 'username@gmail.com',
            To      => 'to@mail.com',
            Subject => 'Subject title',
        ],
        body => 'Content.',
    );

    try {
        sendmail($message, { transport => $transport });
    } catch {
        die "Error sending email: $_";
    };

If you have never used it before, please try Email::Sender::Transport::SMTPS instead. it's recommended.

Email::Sender replaces the old and sometimes problematic Email::Send library, while this module replaces the Email::Send::SMTP::TLS.

It is still alpha, but it works. use it at your own risk!

The following attributes may be passed to the constructor:
host - the name of the host to connect to; defaults to localhost
port - port to connect to; defaults to 587
username - the username to use for auth; required
password - the password to use for auth; required
helo - what to say when saying HELO; no default
allow_partial_success - if true, will send data even if some recipients were rejected

If "allow_partial_success" was set when creating the transport, the transport may return Email::Sender::Success::Partial objects. Consult that module's documentation.

Fayland Lam <fayland@gmail.com>

This software is copyright (c) 2013 by Fayland Lam.

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

2013-11-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.