Email::Sender::Transport::SMTPS - Email::Sender joins Net::SMTPS
use Email::Sender::Simple qw(sendmail); use Email::Sender::Transport::SMTPS; use Try::Tiny; my $transport = Email::Sender::Transport::SMTPS->new( host => 'smtp.gmail.com', ssl => 'starttls', sasl_username => 'myaccount@gmail.com', sasl_password => 'mypassword', debug => 0, # or 1 ); # 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 => 'myaccount@gmail.com', To => 'to@mail.com', Subject => 'Subject title', ], body => 'Content.', ); try { sendmail($message, { transport => $transport }); } catch { die "Error sending email: $_"; };
DEPRECATED. Please use Email::Sender::Transport::SMTP instead.
This transport is used to send email over SMTP, either with or without secure sockets (SSL/TLS). it uses the great Net::SMTPS.
The following attributes may be passed to the constructor:
host
localhost
ssl
port
timeout
sasl_username
sasl_password
username
allow_partial_success
helo
localaddr
localport
debug
If allow_partial_success was set when creating the transport, the transport may return Email::Sender::Success::Partial objects. Consult that module's documentation.
my $transport = Email::Sender::Transport::SMTPS->new({ host => 'smtp.gmail.com', ssl => 'starttls', sasl_username => 'myaccount@gmail.com', sasl_password => 'mypassword', });
my $transport = Email::Sender::Transport::SMTPS->new( host => 'smtp.mandrillapp.com', ssl => 'starttls', sasl_username => 'myaccount@blabla.com', sasl_password => 'api_key', helo => 'fayland.me', );
my $transport = Email::Sender::Transport::SMTPS->new( host => 'email-smtp.us-east-1.amazonaws.com', ssl => 'starttls', sasl_username => 'xx', sasl_password => 'zzz', );
Fayland Lam <fayland@gmail.com>
Copyright 2013- Fayland Lam
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Email::Sender::Transport::SMTPS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::Sender::Transport::SMTPS
CPAN shell
perl -MCPAN -e shell install Email::Sender::Transport::SMTPS
For more information on module installation, please visit the detailed CPAN module installation guide.