...
|
...
|
@@ -172,6 +172,16 @@ class MailFun { |
|
|
$mail->CharSet = 'utf-8';
|
|
|
$mail->Encoding = PHPMailer::ENCODING_QUOTED_PRINTABLE;
|
|
|
|
|
|
// 是否验证证书
|
|
|
if(in_array(parse_url($smtp['host'])['host']??'1-1',['mail.laser-tech.com.cn'])){
|
|
|
$mail->SMTPOptions = [
|
|
|
'ssl' => [
|
|
|
'verify_peer' => false, // 有的证书和域名不匹配,这里关闭认证
|
|
|
'verify_peer_name' => false,// 有的证书和域名不匹配,这里关闭认证
|
|
|
]
|
|
|
];
|
|
|
}
|
|
|
|
|
|
//Recipients,设置发件人
|
|
|
$mail->setFrom($email['email'], $data['nickname']??'');// 显示邮件来自谁
|
|
|
// //设置收件人
|
...
|
...
|
@@ -280,6 +290,16 @@ class MailFun { |
|
|
$mail->Port = $smtp['port']; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
|
|
|
$mail->CharSet = 'utf-8';
|
|
|
$mail->Encoding = PHPMailer::ENCODING_QUOTED_PRINTABLE;
|
|
|
// 是否验证证书
|
|
|
if(in_array(parse_url($smtp['host'])['host']??'1-1',['mail.laser-tech.com.cn'])){
|
|
|
$mail->SMTPOptions = [
|
|
|
'ssl' => [
|
|
|
'verify_peer' => false, // 有的证书和域名不匹配,这里关闭认证
|
|
|
'verify_peer_name' => false,// 有的证书和域名不匹配,这里关闭认证
|
|
|
]
|
|
|
];
|
|
|
}
|
|
|
|
|
|
|
|
|
try {
|
|
|
return $mail->smtpConnect();
|
...
|
...
|
|