PHPMailer saying could not connect to SMTP host

前端 未结 4 1463
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-24 09:30

For the past 2 days I\'ve been trying to get a PHP script to send an e-mail and it doesn\'t seem to work. First I\'ve tried the normal php mail function, then PHPMailer and then

4条回答
  •  臣服心动
    2021-01-24 10:01

    The SMTPOptions line in @David Kariuki's solution fixed my issue. Was getting a SMTP connect failure due to the failure in the TLS handshake.

    $mail->SMTPOptions = array(
                      'ssl' => array(
                          'verify_peer' => false,
                          'verify_peer_name' => false,
                          'allow_self_signed' => true
                      )
                  );
    

提交回复
热议问题