Home: Perl Programming Help: Intermediate:
Mailing List does not work corectly - Why ? Please help



kiho
Deleted

Jul 11, 2000, 10:05 AM


Views: 1028
Mailing List does not work corectly - Why ? Please help

My database has 5 email addresses but I dont know why my script just sent 3 email ?

Please take a look with this script

##################################

sub sendmail {
$pid = fork();
$pid;
if (!pid) {
&error("fork error");
}

if ($pid) {
&sendOK;
exit(0);
}
else {
close (STDOUT);

foreach $email_lines(@email_array) {
chomp($email_lines);

open (MAIL,"| $mailpro -t") | | die ("Can not");
print MAIL "To: $email_lines\n";
print MAIL "From: webmaster\n";
print MAIL "Reply-to: $FORM{'mymail'}\n";
print MAIL "Subject: $FORM{'subject'} \n\n";
print MAIL "$FORM{'message'}\n";
close (MAIL);

}
}
}

##############################

What wrong with this script ? Any idea ? Please tell my why ?


[This message has been edited by kiho (edited 07-11-2000).]