今天無聊,在網上看有人說做一個發卡站不錯,于是去找來源碼安裝了,整個程序安裝下來非常輕松,很快就安裝好了,但是最后設置郵件發送的時候卻把我卡住了,總是郵件發送失敗,由于獨角發卡默認支持tls和ssl發郵件,我也按照郵件客戶端的設置,在后臺進行了相應的設置,但是不管我用tls還是ssl,都是無法發送,tls發送提示連接超時,ssl發送提示“Connection could not be established with host,localhost and "stream_socket_enable_crypto(): SSL operation failed with code 1" ”考慮到郵件服務器是采用https的,所以重點考慮ssl發送郵件錯誤的解決方法。終于在網上搜到依葫蘆畫瓢,發送成功!
第二種:修改vendorswiftmailerlibclassesSwiftTransportStreamBuffer.php line 259 ish. comment out the $options = array(); and add the below.
$options = array();
$options['ssl'] = array('verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true);
這個我沒有驗證,大家又遇到的自行測試吧。
另外,上面也提到,忽略ssl校驗有一定的安全風險,實際上phpmailer也已經針對這種情況提出了解決方案,兼顧驗證的情況下發出郵件,具體如下:
$mail->SMTPOptions = array (
'ssl' => array(
'verify_peer' => true,
'verify_depth' => 3,
'allow_self_signed' => true,
'peer_name' => 'smtp.example.com',
'cafile' => '/etc/ssl/ca_cert.pem',
)
);
$options = array();
$options['ssl'] = array('verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true); $mail->SMTPOptions = array (
'ssl' => array(
'verify_peer' => true,
'verify_depth' => 3,
'allow_self_signed' => true,
'peer_name' => 'smtp.example.com',
'cafile' => '/etc/ssl/ca_cert.pem',
)
);
麥芽香一杯茶論壇網址是多少呀a0cc.cn
華納圣淘沙開戶步驟詳解(183-8890-9465—?薇-STS5099【6011643】
華納圣淘沙公司開戶流程全解析(183-8890-9465—?薇-STS5099【6011643】
華納圣淘沙公司賬戶注冊指南(183-8890-9465—?薇-STS5099【6011643】
新手如何開通華納圣淘沙公司賬戶(183-8890-9465—?薇-STS5099【6011643】
華納圣淘沙企業開戶標準流程(183-8890-9465—?薇-STS5099【6011643】
華納圣淘沙公司開戶:從零到一(183-8890-9465—?薇-STS5099【6011643】
官方指南:華納圣淘沙公司開戶流程(183-8890-9465—?薇-STS5099【6011643】
華納圣淘沙公司開戶流程說明書(183-8890-9465—?薇-STS5099【6011643】
果博東方客服開戶聯系方式【182-8836-2750—】?薇- cxs20250806】
果博東方公司客服電話聯系方式【182-8836-2750—】?薇- cxs20250806】
果博東方開戶流程【182-8836-2750—】?薇- cxs20250806】
果博東方客服怎么聯系【182-8836-2750—】?薇- cxs20250806】
555
藍天使
藍百萬2
別碰臟錢
1
1
無限旅程