Here is what i use for my online checker, its perl and requires sendmail. but here it is
#!/usr/bin/perl
use Net::Ping;
use Fcntl;
$loc = "hosts";
sub sendEmail
{
my ($to, $from, $subject, $message) = @_;
my $sendmail = '/usr/lib/sendmail';
open(MAIL, "|$sendmail -oi...