On Thu, Jan 11, 2007 at 04:04:38PM -0500, Akbar Ehsan wrote:

> The form has a bunch of check boxes:
> 
>                 <input type="checkbox" name="field1" value="andadm">
>                 Anderson<br>
>                 <input type="checkbox" name="field1" value="blmadm">
>                 Bloomington<br>
> 
>                 <input type="checkbox" name="field1" value="coladm">
>                 Columbus <br>
>                 <input type="checkbox" name="field1" value="echadm">
>                 East Chicago<br>
>                 <input type="checkbox" name="field1" value="elkadm">
>                 Elkhart<br>


At this point you need to assign different names to the checkboxes, 
field2,field3 etc 



> The value of the checkbox is part of the out. To this the recipient adds
> @somewhere.com and mails it.



> 
> The relevant CGI code is:
> 
> # got the report in memory, ready to put in email
> # checking who goes to
> 


> 
> # Get the list of fields into an array
> my @locs = split(/,/, $locations);    
> my @fields = split(/,/, $in{'field_names'});
> my $mailto = $locs["$in{'field1'}"];
> $mailto .= "[EMAIL PROTECTED]";   

Yes, that prepends the single value submitted to the domain 


Something missing here, or maybe I have been using CGI.pm too long and 
forgotten what how it was 
done in the early years. 

Do you have a statement at the start of your cgi script that says something 
like;

use CGI; or

require cgi-lib.pl;     ????

> 
> # Email whoever's in $mailto

That's the clue to work backwards from. all your addressess have to be in 
$mailto, but that's a 
scalar

You need an array of collected email addresses, in CGI.pm parlance, thats

@names = $q->param;  but I don't know what library you are using


Then with the array, you can add further addresses to it, and finally, go 
through the array and 
send your e-mails


foreach my $address(@names){ do the send mail routine }


Owen





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to