open(MAIL, "|/usr/sbin/sendmail -t"); ## Mail Header print MAIL "To: $from\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; ## Mail Body print MAIL "This is a test mail"; close(MAIL);