作者 邓超

1

@@ -166,14 +166,25 @@ class Home extends Base { @@ -166,14 +166,25 @@ class Home extends Base {
166 $sendData['email'] = $email['email']; 166 $sendData['email'] = $email['email'];
167 $sendData['nickname'] = $formData['nickname']??''; 167 $sendData['nickname'] = $formData['nickname']??'';
168 $sendData['tos'] = $formData['tos']; 168 $sendData['tos'] = $formData['tos'];
  169 + if(count($sendData['tos'])>100){
  170 + app()->e(['tos_number_error',100]);
  171 + }
169 // 抄送 172 // 抄送
  173 + $sendData['cc'] = [];
170 if(($formData['isCc']??0) && !empty($formData['cc'])){ 174 if(($formData['isCc']??0) && !empty($formData['cc'])){
171 $sendData['cc'] = $formData['cc']; 175 $sendData['cc'] = $formData['cc'];
172 } 176 }
  177 + if(count($sendData['cc'])>10){
  178 + app()->e(['cc_number_error',10]);
  179 + }
173 // 密送 180 // 密送
  181 + $sendData['bcc'] = [];
174 if(($formData['isBcc']??0) && !empty($formData['bcc'])){ 182 if(($formData['isBcc']??0) && !empty($formData['bcc'])){
175 $sendData['bcc'] = $formData['bcc']; 183 $sendData['bcc'] = $formData['bcc'];
176 } 184 }
  185 + if(count($sendData['bcc'])>10){
  186 + app()->e(['bcc_number_error',10]);
  187 + }
177 $sendData['reply_to'] = [];//回复到那个邮件 188 $sendData['reply_to'] = [];//回复到那个邮件
178 //Attachments 附件 上传的 189 //Attachments 附件 上传的
179 $sendData['attachment'] = []; 190 $sendData['attachment'] = [];
@@ -67,6 +67,9 @@ return [ @@ -67,6 +67,9 @@ return [
67 'to_cc' => '抄送', 67 'to_cc' => '抄送',
68 'to_bcc' => '密送', 68 'to_bcc' => '密送',
69 'cc_verify_error' => '抄送人邮箱地址错误 %s', 69 'cc_verify_error' => '抄送人邮箱地址错误 %s',
  70 + 'cc_number_error' => '抄送人不能超过 %s 个',
  71 + 'bcc_number_error' => '密送人不能超过 %s 个',
  72 + 'tos_number_error' => '收件人不能超过 %s 个',
70 'bcc_verify_error' => '密送人邮箱地址错误 %s', 73 'bcc_verify_error' => '密送人邮箱地址错误 %s',
71 'attachment_upload_error' => '附件上传失败 %s', 74 'attachment_upload_error' => '附件上传失败 %s',
72 75