open(MAIL, "|/usr/lib/sendmail -oi -t -odq") || die "Can't open sendmail: $!"; print MAIL < To: Recipient name Subject: Mailing with Perl this is easy. MESSAGE close(MAIL);