...
|
...
|
@@ -177,6 +177,21 @@ 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(!empty($email['proxy'])){
|
|
|
$mail->SMTPOptions['http']= [
|
|
|
'proxy' => $email['proxy'], // 代理地址
|
|
|
'request_fulluri' => true,
|
|
|
];
|
|
|
}
|
|
|
|
|
|
// 是否验证证书
|
|
|
$mail->SMTPOptions = [
|
|
|
'ssl' => [
|
|
|
'verify_peer' => false, // 有的证书和域名不匹配,这里关闭认证
|
|
|
'verify_peer_name' => false,// 有的证书和域名不匹配,这里关闭认证
|
|
|
]
|
|
|
];
|
|
|
|
|
|
// 添加自定义头信息
|
|
|
if(!empty($data['mail-header']) && is_array($data['mail-header'])){
|
...
|
...
|
@@ -186,15 +201,6 @@ class MailFun { |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 是否验证证书
|
|
|
// 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']??'');// 显示邮件来自谁
|
...
|
...
|
|