in reply to Re^2: sendmail with perl
in thread sendmail with perl

If you insist on doing it that way, it is your job to decipher the sendmail program. The Evolution of Perl Email Handling