App-CLI-Plugin-Net-SMTP

 view release on metacpan or  search on metacpan

lib/App/CLI/Plugin/Net/SMTP.pm  view on Meta::CPAN

	if (ref($smtp_option) ne "HASH") {
		$smtp_option = $self->config->{net_smtp};
	}
	if (!defined $smtp_option) {
		die "net_smtp option is always required";
	}

	if( (exists $ENV{APPCLI_SMTP_STARTTLS} && defined $ENV{APPCLI_SMTP_STARTTLS}) ||
		(exists $smtp_option->{StartTLS} && defined $smtp_option->{StartTLS}) ||
		(exists $self->{starttls} && defined $self->{starttls}) ){
		require IO::Socket::SSL;
		unshift @Net::SMTP::ISA, "IO::Socket::SSL";
	}

	$self->smtp(Net::SMTP->new(%{$smtp_option}) or die $!);
}

=head2 smtp

return Net::SMTP object. Environment variable APPCLI_SMTP_STARTTLS, net_smtp to StartTLS, the script runs starttls option, you specify one, IO::Socket::SSL If you have installed on your system, SMTPS can make a connection with.

But even then one way, net_smtp option of the Port is defined as SMTPS to specify the port number

Example1 APPCLI_SMTP_STARTTLS:

  # if your shell is bash...
  export APPCLI_SMTP_STARTTLS=1

Example2 StartTLS config:



( run in 0.482 second using v1.01-cache-2.11-cpan-4d50c553e7e )