open( MAIL, "| $sendmail -t" ) or die "Can't start $sendmail : $!\n"; print MAIL "To: $_"; print MAIL "From: $adminmail"; print MAIL "Subject: $subject\n\n"; print MAIL "$message"; print MAIL "."; close(MAIL) or die "Failed to send the mail: $! $?\n";