第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

PHP Mailer - 454 TLS 連接失敗

PHP Mailer - 454 TLS 連接失敗

PHP
收到一只叮咚 2023-03-11 17:23:04
在我的頁面上,我有一個使用 PHP Mailer 的聯(lián)系表格。一開始,僅出于測試目的,我將其與我的 Gmail 帳戶一起使用。一切都像一個魅力。然后我決定將電子郵件服務(wù)從 Gmail 更改為來自我的托管服務(wù)提供商的服務(wù)。然后問題就開始了。每次我嘗試發(fā)送電子郵件時,都會發(fā)生異常:2020-05-13 20:53:44 CLIENT -> SERVER: STARTTLS2020-05-13 20:53:44 SERVER -> CLIENT: 220 ready for tlsSMTP Error: Could not connect to SMTP host.2020-05-13 20:53:44 CLIENT -> SERVER: QUIT2020-05-13 20:53:44 SERVER -> CLIENT: 454 TLS connection failed: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (#4.3.0)2020-05-13 20:53:44 SMTP ERROR: QUIT command failed: 454 TLS connection failed: error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure (#4.3.0)這是我發(fā)送電子郵件的代碼:<?php    use PHPMailer\PHPMailer\PHPMailer;    use PHPMailer\PHPMailer\Exception;    use PHPMailer\PHPMailer\SMTP;    require 'PHPMailer.php';    require 'SMTP.php';    require 'Exception.php';    class Mailer    {        private $mail;        public function __construct($host, $user, $password, $port = 587)        {            $this->mail = new PHPMailer();            try            {                $this->mail->SMTPDebug = SMTP::DEBUG_SERVER;                  $this->mail->CharSet    = "UTF-8";                $this->mail->isSMTP();                $this->mail->Host       = $host;                $this->mail->SMTPAuth   = true;                $this->mail->SMTPSecure = 'ssl';                $this->mail->Username   = $user;                $this->mail->Password   = $password;                $this->mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;                $this->mail->Port       = $port;            }            catch(Exception $e)            {                echo "Exception: " . $e;            }        }我想我在 TLS/SSL 方面錯誤地配置了 PHP Mailer,因為我對此很新手。我的網(wǎng)頁使用 TLS 1.3 加密可能是一個權(quán)宜之計
查看完整描述

1 回答

?
青春有我

TA貢獻(xiàn)1784條經(jīng)驗 獲得超8個贊

這是一個提示,如果有效,請不要忘記投票以加強(qiáng)。讓我們?nèi)ピO(shè)置...


$mail->SMTPOptions = array(

    'ssl' => array(

        'verify_peer' => false,

        'verify_peer_name' => false,

        'allow_self_signed' => false

    )

);

請記住,這是一種可以立即起作用的姑息解決方案,但我建議調(diào)查問題。另一個細(xì)節(jié)有時會使用端口 465 和 587 進(jìn)行測試!


$mail->Port = "587";

$mail->SMTPSecure = "tls";

另一件事我不明白......為什么我要使用$ this->mail->SMTPSecure兩次?


 $this->mail->SMTPSecure = 'ssl';

 $this->mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;


查看完整回答
反對 回復(fù) 2023-03-11
  • 1 回答
  • 0 關(guān)注
  • 183 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號