У меня возникли проблемы с отправкой электронной почты с помощью PHPMailer через мой SMTP, который включен ssl.Ошибка PHPMailer с ssl
$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 является действительным.
Update:
Got последняя версия и набор отладки до 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
Как насчет поворота вывод отладки? 'SMTPDebug = 3' должно быть достаточно. – Synchro
Похоже, вы используете старую версию PHPMailer, так что [получите последнюю версию] (https://github.com/PHPMailer/PHPMailer). – Synchro