0

SSL が有効になっている SMTP を介して PHPMailer でメールを送信する際に問題があります。

$mail = new PHPMailer;
// HTML email!
$mail->IsHTML(true);
$mail->isSMTP();
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = "server.co.tz";
//Set the SMTP port number - likely to be 25, 465 or 587
$mail->Port = 465;
$mail->SMTPSecure = "ssl";
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication
$mail->Username = "xxxxxxx";
//Password to use for SMTP authentication
$mail->Password = "yyyyyyy";

スクリプトを実行すると、次のエラーが表示されます。

Mailer Error: SMTP connect() failed.

また、exim4 ログでは次のようになります。

2016-02-24 11:02:20 TLS error on connection from [197.215.254.114] (gnutls_handshake): A TLS fatal alert has been received.

ここで何が問題なのかわかりません。

メール クライアントに定期的に SMTP を使用しており、SSL 証明書は有効なものです。

アップデート:

最新バージョンを取得し、デバッグを 3 に設定しましたが、まだうまくいきません:

Connection: opening to ssl://fsm.co.tz:465, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
4

2 に答える 2