From 33efacfdaaa00792653f78600e53c78de5e6e633 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Sat, 9 Sep 2017 20:13:19 +0200 Subject: [PATCH] util: automated-search.php fix Signed-off-by: Janos SUTO --- util/automated-search.php | 10 +++++++++- webui/view/theme/default/templates/search/auto.tpl | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/util/automated-search.php b/util/automated-search.php index 38756677..bea25baa 100644 --- a/util/automated-search.php +++ b/util/automated-search.php @@ -215,6 +215,8 @@ function do_search($data = array(), $automated_search_recipients = array()) $a['date1'] = $a['date2'] = date("Y.m.d", time() - 86400); } + $boundary = "--=_NextPart_000_ABCDEFGHI"; + list ($n, $total_found, $all_ids, $messages) = $search->search_messages($a, 0); if($dry_run == 0) @@ -225,13 +227,19 @@ function do_search($data = array(), $automated_search_recipients = array()) $msg .= "Subject: =?UTF-8?Q?" . preg_replace("/\n/", "", my_qp_encode($title)) . "?=" . EOL; $msg .= "Message-ID: <" . generate_random_string(25) . '@' . SITE_NAME . ">" . EOL; $msg .= "MIME-Version: 1.0" . EOL; - $msg .= "Content-Type: text/html; charset=\"utf-8\"" . EOL; + $msg .= "Content-Type: multipart/alternative;" . EOL; + $msg .= "\tboundary=\"$boundary\"" . EOL; $msg .= EOL . EOL; + $msg .= "--$boundary" . EOL; + $msg .= "Content-Type: text/html; charset=\"utf-8\"" . EOL . EOL; + ob_start(); include($webuidir . "/view/theme/default/templates/search/auto.tpl"); $msg .= ob_get_contents(); + $msg .= "--" . $boundary . EOL . EOL; + ob_end_clean(); $x = $mail->send_smtp_email(SMARTHOST, SMARTHOST_PORT, SMTP_DOMAIN, SMTP_FROMADDR, $automated_search_recipients, $msg); diff --git a/webui/view/theme/default/templates/search/auto.tpl b/webui/view/theme/default/templates/search/auto.tpl index cc268f30..57498fd9 100644 --- a/webui/view/theme/default/templates/search/auto.tpl +++ b/webui/view/theme/default/templates/search/auto.tpl @@ -47,7 +47,7 @@   - + !