@email = ($email,$pscemail1,$pscemail2,$pscemail3,$pscemail4,$pscemail5,$pscemail6,$pscemail7,$pscemail8); foreach $address (@email) { open (HTMLMAIL, "|$sendmail $address") || die "Can't open $sendmail!\n"; print HTMLMAIL "From: $name <$adminemail>\n"; #print HTMLMAIL "Reply-to: $fromname <$fromemail>\n"; print HTMLMAIL "To: $address\n"; print HTMLMAIL "Subject: $subject\n"; print HTMLMAIL "Content-type: text/html\n"; Print HTMLMAIL "blah blah blah"; close (HTMLMAIL); }