#!/usr/bin/php -c /usr/lib/php.ini $to = "$user_mail"; $subject = "** $notification_type - $host_displayname - $service_desc is $service_output **"; $body = "
"; $body .= ""; $f_color="#dddddd"; if($service_state=="WARNING") {$f_color="#f48400";} if($service_state=="CRITICAL") {$f_color="#f40000";} if($service_state=="OK") {$f_color="#00b71a";} if($service_state=="UNKNOWN") {$f_color="#cc00de";} $body .= "Notification Type | $from , "To" => $to ,"Subject" => $subject, "Content-Type" => "text/html; charset=ISO-8859-1; MIME-Version: 1.0");
$smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => false));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo(" " . $mail->getMessage() . " "); } else { echo("Message successfully sent! "); |