echo "fail"; return; } $content = $stmt1->result(0); if ($format == "default") { $stmt2->execute($profile_id, $username); $format = $stmt2->result(0); } if ($format == 'txt') { /** * The 'false' here means that the html or text is not embedded * so nessquik will not strip off the HTML,HEAD,BODY etc tags, * and will not replace newline (\n) chars in the text format * with <br> tags */ $output = $nes->output_text($content, false); $ext = 'txt'; } elseif ($format == 'html') { $output = $nes->output_html($content, false); $ext = 'html'; } else { if ($format == 'nbe') { $output = $nes->output_nbe($content, false); $ext = 'nbe'; } } /** * The empty field is the alternate recipients list. * The $ext value in the function call will work fine as long * as I dont changet the 'html' string above because that * is how the send_email function determines if it should
$subject = $settings['custom_email_subject']; // The next couple blocks of code are replacing the available // macros in the subject line if (count($machine_list) > 2) { $subject = str_replace("%m", $machine_list[0] . ',' . $ok_computers[1] . '...', $subject); } elseif (count($machine_list) > 1) { $subject = str_replace("%m", $machine_list[0] . ' and ' . $machine_list[1], $subject); } else { $subject = str_replace("%m", $machine_list[0], $subject); } $subject = str_replace("%D", $start_date, $subject); $subject = str_replace("%d", $end_date, $subject); $subject = str_replace("%T", $start_time, $subject); $subject = str_replace("%t", $end_time, $subject); if ($format == 'txt') { $output = $nes->output_text($output); } else { if ($format == 'html') { $output = $nes->output_html($output); } else { if ($format == 'nbe') { $output = $nes->output_nbe($output); } } } if (_DEBUG) { fwrite($dfh, "\nEmailing scan results"); } // If there are multiple recipients, then they need to have email sent to them if (count($recipients) > 0) { if (!$client->query('jobs.emailResults', _CLIENT_KEY, $profile_id, $recipients, $subject, $output, $format)) {