in reply to Sendmail Problem

Don't have the time to translate your code. I highly recommend using MIME::Lite. It is the bellwether for sending email with Perl.