the first thing i noted:
$MailProgram = '/usr/sbin/sendmail-t';
which is completely wrong -
$MailProgram = '/usr/sbin/sendmail -t';
other thing i noted:
$MailProgram .= ' -t' if $MailProgram =~ /sendmail\Z/; # This line adding ' -t ' to sendmail when it's just /usr/sbin/sendmail - but you have defined your sendmail with -t at the top why to add this line?
hope this will help you