First off, sending stuff directly to Sendmail can be extraordinarily dangerous. You have to be very dilligent about what you actually send in as data or you could have a very unpleasant surprise. Think about what might happen if someone passed in an email address as the string "hahascrewyou@suckers.com; rm -rf ~". You're not sending in that kind of stuff on the command line, but still, taint checking is your friend, as will be libraries such as Email::Valid. Despite all the precautions you might take, and the fact that you're not passing args on the command line but rather through stdin helps, it's still messy and you're better off using a wrapper library.
I use Mail::Mailer. Assuming that you're not passing around bogus data, here's the basic code snippet that I use.
my $mailer = Mail::Mailer->new('sendmail');
$mailer->open({From => 'someone@somewhere.com',
To => 'recipient@someplace.com',
Subject => 'this is the subject'});
print $mailer "this is the body!";
$mailer->close();
|