Tom Harmon wrote:
> 
> 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.

Well, another suggestions is to use HERE-DOCUMENTS:
print MAIL <<"END_OF_MAIL";
To: $emailto
From: $emailfrom
Subject:

Included Message 

END_OF_MAIL

Reads better, isn't it ?!


Greetings,
Andrea

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to