There is probably nothing wrong with your perl code. If you're sending this from a Unix box than this machine needs to be setup to send mail from the account you're using. I've had problems similar to this.
I don't really know how exactly this sendmail config works but I suggest you look at your machine sendmail setup before poking around with the perl code.