作者 邓超

x

@@ -315,6 +315,14 @@ class Home extends Base { @@ -315,6 +315,14 @@ class Home extends Base {
315 if(($formData['isBcc']??0) && !empty($formData['bcc'])){ 315 if(($formData['isBcc']??0) && !empty($formData['bcc'])){
316 $sendData['bcc'] = $formData['bcc']; 316 $sendData['bcc'] = $formData['bcc'];
317 } 317 }
  318 +
  319 + // 添加自定义头信息 预热邮件
  320 + if(!empty($formData['aicc-hot'])){
  321 + $sendData['mail-header'] = [
  322 + 'Aicc-Hot-Mail' => 'hot' // 预热邮件
  323 + ];
  324 + }
  325 +
318 if(count($sendData['bcc'])>10){ 326 if(count($sendData['bcc'])>10){
319 app()->e(['bcc_number_error',10]); 327 app()->e(['bcc_number_error',10]);
320 } 328 }
@@ -846,7 +846,7 @@ class Imap { @@ -846,7 +846,7 @@ class Imap {
846 // body字段必须放最后 846 // body字段必须放最后
847 if($header2Body=='header'){ 847 if($header2Body=='header'){
848 // BODY.peek必须放最后 848 // BODY.peek必须放最后
849 - $filed = 'UID FLAGS INTERNALDATE RFC822.SIZE BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO X-PRIORITY CONTENT-TRANSFER-ENCODING BCC IN-REPLY-TO MAIL-FOLLOWUP-TO MAIL-REPLY-TO MESSAGE-ID REFERENCES RESENT-BCC RETURN-PATH SENDER X-DRAFT-INFO)]'; 849 + $filed = 'UID FLAGS INTERNALDATE RFC822.SIZE BODYSTRUCTURE BODY.PEEK[HEADER.FIELDS (DATE FROM TO SUBJECT CONTENT-TYPE CC REPLY-TO LIST-POST DISPOSITION-NOTIFICATION-TO X-PRIORITY CONTENT-TRANSFER-ENCODING BCC IN-REPLY-TO MAIL-FOLLOWUP-TO MAIL-REPLY-TO MESSAGE-ID REFERENCES RESENT-BCC RETURN-PATH SENDER X-DRAFT-INFO AICC-HOT-MAIL)]';
850 }elseif($header2Body=='body'){ 850 }elseif($header2Body=='body'){
851 $filed = 'RFC822.TEXT'; 851 $filed = 'RFC822.TEXT';
852 }else{ 852 }else{
@@ -172,6 +172,14 @@ class MailFun { @@ -172,6 +172,14 @@ class MailFun {
172 $mail->CharSet = 'utf-8'; 172 $mail->CharSet = 'utf-8';
173 $mail->Encoding = PHPMailer::ENCODING_QUOTED_PRINTABLE; 173 $mail->Encoding = PHPMailer::ENCODING_QUOTED_PRINTABLE;
174 174
  175 + // 添加自定义头信息
  176 + if(!empty($data['mail-header']) && is_array($data['mail-header'])){
  177 + foreach ($data['mail-header'] as $k=>$v){
  178 + // 在邮件体中添加自定义标识 预热
  179 + $mail->addCustomHeader($k,$v);
  180 + }
  181 + }
  182 +
175 // 是否验证证书 183 // 是否验证证书
176 // if(in_array(parse_url($smtp['host'])['host']??'1-1',['mail.laser-tech.com.cn'])){ 184 // if(in_array(parse_url($smtp['host'])['host']??'1-1',['mail.laser-tech.com.cn'])){
177 $mail->SMTPOptions = [ 185 $mail->SMTPOptions = [