open(SENDMAIL, '|/usr/sbin/sendmail -oi -t') or do{ unlink($outfile); diehtml("Can't fork for sendmail: $!\n")}; #### print SENDMAIL $msg close SENDMAIL; #### print SENDMAIL <<"EOF"; #### EOF close(SENDMAIL) or warn "sendmail didn't close nicely";