this should work:
$mailfile = "/loc/of/addressfile";
open( ADDRESSES,$mailfile ) || &security;
@addresses = <ADDRESSES>;
close ADDRESSES;
$emailto = join(",",@addresses);
the rest of the script shouldn't need a change, except that you'll want to
comment out the line that's defining the $emailto variable.
Rob.
----- Original Message -----
From: Tom Harmon <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 08, 2001 3:26 PM
Subject: Sending automatic email to list of addresses
> I have a script that sends an email to a predefined recipient when a
database is
> updated. I would like to find out how I might convert this so it will open
a list file of
> email addresses and send a copy to each address in the file.
>
> Currently, my script looks like this;
>
> $sendmailer="/bin/sendmail";
>
> $emailto="recipient\@host.com";
>
> $emailfrom="sender\@host.com";
>
> $problem="Can't send mail, check location of sendmail program for patch";
> open (MAIL, "| $sendmailer -t") || &security;
> print MAIL "To: $emailto\n";
> print MAIL "From: $emailfrom\n";
> print MAIL "Subject:\n";
> print MAIL "\n";
> print MAIL "Included Message \n";
> print MAIL "\n";
> close(MAIL);
>
> #end
>
> If anybody has a patch for this or any suggestions, they would be greatly
> appreciated.
>
>
>
> Regards,
> Tom Harmon
> Softouch Interactive Sales and Marketing Division
> http://www.hharmon.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]