aboutsummaryrefslogtreecommitdiffstats
path: root/config/mailreport
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-01-12 13:17:25 -0500
committerjim-p <jimp@pfsense.org>2012-01-12 13:19:01 -0500
commit74968be46922c2b356bb2a86a17a99bcf2f82efe (patch)
tree3e3e18c53ccf1c6f550f5588bc03ccfee4535916 /config/mailreport
parentd533cf7e8ff100e98590c30d1600c441ce2c78c9 (diff)
downloadpfsense-packages-74968be46922c2b356bb2a86a17a99bcf2f82efe.tar.gz
pfsense-packages-74968be46922c2b356bb2a86a17a99bcf2f82efe.tar.bz2
pfsense-packages-74968be46922c2b356bb2a86a17a99bcf2f82efe.zip
Switch to inline attachments for e-mail graphs reports
Diffstat (limited to 'config/mailreport')
-rw-r--r--config/mailreport/mail_reports.inc6
1 files changed, 4 insertions, 2 deletions
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']}.<br/><br/>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 .= "<br/><br/>{$shortname}<br/><img src=\"cid:{$shortname}\" />\n";
}
}
- $mail->Body .= "This is a periodic graph report from your firewall, {$config['system']['hostname']}.{$config['system']['domain']}.<br/><br/>Current report: {$headertext}";
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;