"; $to = "YOUR MAIL <".$recipients.">"; if ($argv[1]) $subject = "Error - server down!"; else $subject = "Server's up!"; $body = " "; $host = "smtp.gmail.com"; //or your SMTP provider $username = $recipients; $password = "YOURPASSWORD"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo($mail->getMessage()); } ?>