作者 邓超

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

... ... @@ -265,6 +265,15 @@ class MailFun {
);
$mail->addCustomHeader('AICC-RANDSTR-UUID',$randStr);
// 保证百度编辑器里面没有远程链接图,增加发送成功率
// 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%;}
// 把body内容里面的 <link rel="stylesheet" type="text/css" href="https://fob.ai.cc/assets/plugins/ueditor/themes/iframe.css?v=3"> 替换为 <style>...</style>
$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']);
// 把<style id="tablesort"></style> 替换成空
$data['body'] = preg_replace('/<style id="tablesort">[\s\S]+<\/style>/iU', '', $data['body']);
$data['body'] = preg_replace('/<style id="loading">[\s\S]+<\/style>/iU', '', $data['body']);
$data['body'] = preg_replace('/<style id="anchor">[\s\S]+<\/style>/iU', '', $data['body']);
$mail->Body = $data['body'];// html格式的内容
$gmail = false;
... ...