in reply to SendMail won't send mail
You don't show the close(MAIL), but I'm guessing that you're not checking errors there. If your "$mailprog -t" returns an error, it'll show up on the close.
In Section
Seekers of Perl Wisdom
in reply to SendMail won't send mail