From 74968be46922c2b356bb2a86a17a99bcf2f82efe Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 12 Jan 2012 13:17:25 -0500 Subject: Switch to inline attachments for e-mail graphs reports --- config/mailreport/mail_reports.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/mailreport/mail_reports.inc b/config/mailreport/mail_reports.inc index d94631cc..0460bbc6 100644 --- a/config/mailreport/mail_reports.inc +++ b/config/mailreport/mail_reports.inc @@ -191,12 +191,14 @@ function mail_report_send($headertext, $attachments) { $address = $config['notifications']['smtp']['notifyemailaddress']; $mail->AddAddress($address, "Report Recipient"); $mail->Subject = "{$config['system']['hostname']}.{$config['system']['domain']} Graph Report: {$headertext}"; + $mail->Body .= "This is a periodic graph report from your firewall, {$config['system']['hostname']}.{$config['system']['domain']}.

Current report: {$headertext}\n"; if(is_array($attachments)) { foreach($attachments as $filename) { - $mail->AddAttachment("$filename", basename($filename)); + $shortname = basename($filename); + $mail->AddEmbeddedImage("$filename", $shortname, "$filename"); + $mail->Body .= "

{$shortname}
\n"; } } - $mail->Body .= "This is a periodic graph report from your firewall, {$config['system']['hostname']}.{$config['system']['domain']}.

Current report: {$headertext}"; if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; -- cgit v1.2.3