#!/usr/bin/perl -n # thanks to Brian Dowling for an example with security in mind. $TO = 'user@company.com'; $FROM = 'user@company.com'; s/^<\d{1,2}>//; open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL <<"EOT"; To: $TO From: $FROM Subject: Uplink Went Down: $_ $_ EOT close(MAIL);