in reply to sendmail close error

Have you checked sendmail and perl versions, and are you using:
use strict; use warnings;