「をオンにします」されていることを確認します。 Net :: SMTP :: TLSの代わりに、私はMIME :: Liteを使用しました。
#!/usr/bin/perl
use MIME::Lite;
use Net::SMTPS;
my $file="/var/www/myweb/myfile.txt";
open(FILE, $file) or die "Can't read file 'filename' [$!]\n";
$document = <FILE>;
close (FILE);
my $msg = MIME::Lite ->new (
From => '[email protected]',
To => '[email protected]',
Subject => 'mail subject',
Data => qq{
<body>
Text message body HTML format. <p> $document </p>
</body>
},
Type => 'text/html; charset=UTF-8'
);
my $USERNAME = '[email protected]';
my $PASSWORD = 'password';
my $smtps = Net::SMTPS->new("smtp.live.com", Port => 587, doSSL=> 'starttls', SSL_version=>'TLSv1');
$smtps->auth ($USERNAME, $PASSWORD) or DIE("Could not authenticate with mail.\n");
$smtps ->mail('[email protected]');
$smtps->to('[email protected]');
$smtps->data();
$smtps->datasend($msg->as_string());
$smtps->dataend();
$smtps->quit;
私はGmail.comではなくOutlook.comサービスを使用しています。
ありがとうございました!
[関連](http://stackoverflow.com/questions/34455133/error-sslv3-alert-handshake-failure-using-netsmtptls)、[また、(http://stackoverflow.com/questions/26385603/) Facebookの-SDK-FOR-PHP-エラーcurlexception-35-error14094410ssl-routinesssl3)、[また](http://openssl.6102.n7.nabble.com/TLS-ALERT-PROTOCOL-VERSION-Error-td12978.html ) – 123