sybperl-l Archive
Up Prev Next
From: LNowak at aol dot com
Subject: Re: reg unix sendmail
Date: Jun 9 2000 5:54PM
Lots of different ways to do it - but basically open sendmail like a file and
pipe the command that sendmail is looking for along with the body of the
mail. This has always worked for me so I created a module and just pass it
arguments.
Leigh
One of many ways:
#######################################################
$sendmail = "path/to/sendmail";
open(SENDMAIL, "| $sendmail -t");
print SENDMAIL "To: \n";
print SENDMAIL "Subject: \n";
foreach $line (@body)
{
print SENDMAIL $line;
}
close (SENDMAIL);
########################################################
|