作者 邓超

踢出 百度编辑器里面不需要的 远程链接图片

@@ -265,6 +265,15 @@ class MailFun { @@ -265,6 +265,15 @@ class MailFun {
265 ); 265 );
266 $mail->addCustomHeader('AICC-RANDSTR-UUID',$randStr); 266 $mail->addCustomHeader('AICC-RANDSTR-UUID',$randStr);
267 267
  268 + // 保证百度编辑器里面没有远程链接图,增加发送成功率
  269 +// body{padding:0;word-wrap:break-word;cursor:text;}body{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:0 0;}.max-w-full{max-width: 100%;}
  270 + // 把body内容里面的 <link rel="stylesheet" type="text/css" href="https://fob.ai.cc/assets/plugins/ueditor/themes/iframe.css?v=3"> 替换为 <style>...</style>
  271 + $data['body'] = preg_replace('/<link rel="stylesheet" type="text\/css" href="https:\/\/fob.ai.cc\/assets\/plugins\/ueditor\/themes\/iframe.css\?v=[\d]">/iU', '<style>body{padding:0;word-wrap:break-word;cursor:text;}body{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:0 0;}.max-w-full{max-width: 100%;}</style>', $data['body']);
  272 + // 把<style id="tablesort"></style> 替换成空
  273 + $data['body'] = preg_replace('/<style id="tablesort">[\s\S]+<\/style>/iU', '', $data['body']);
  274 + $data['body'] = preg_replace('/<style id="loading">[\s\S]+<\/style>/iU', '', $data['body']);
  275 + $data['body'] = preg_replace('/<style id="anchor">[\s\S]+<\/style>/iU', '', $data['body']);
  276 +
268 $mail->Body = $data['body'];// html格式的内容 277 $mail->Body = $data['body'];// html格式的内容
269 278
270 $gmail = false; 279 $gmail = false;