App-mailmake
view release on metacpan or search on metacpan
scripts/mailmake view on Meta::CPAN
{
my $mail = shift( @_ );
unless( defined( $opts->{smtp_host} ) && length( $opts->{smtp_host} ) )
{
_die( "No SMTP host specified. Use --smtp-host (or --print to output the message instead)." );
}
my %smtp_opts = (
Host => $opts->{smtp_host},
Timeout => $opts->{smtp_timeout} // 30,
);
$smtp_opts{Port} = $opts->{smtp_port} if( defined( $opts->{smtp_port} ) );
$smtp_opts{SSL} = 1 if( $opts->{smtp_tls} );
$smtp_opts{StartTLS} = 1 if( $opts->{smtp_starttls} );
$smtp_opts{Username} = $opts->{smtp_user} if( defined( $opts->{smtp_user} ) );
$smtp_opts{Password} = $opts->{smtp_password} if( defined( $opts->{smtp_password} ) );
$smtp_opts{Debug} = 1 if( $DEBUG >= 3 );
_message( 2, "Sending via <green>$opts->{smtp_host}</>." );
my $rcpts = $mail->smtpsend( %smtp_opts );
( run in 2.849 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )