in reply to CGI/PERL email form that will send to multiple address based on checkbox selection

If you were to use CGI.pm's param() method to retrieve form values and if you were to name all checkboxes the same, you could use a hash slice. Any day you can do that is a good day.

my @mail_groups = $q->param( 'mailgroup' ); my %group_addresses = ( group1 => 'group1@domain.com', group2 => 'group2@domain.com', group3 => 'group3@domain.com', ); my @mail_addresses = @group_addresses{ @mail_groups }; my $to = join(', ', grep { defined } @mail_addresses );
  • Comment on Re: CGI/Perl email form that will send to multiple address based on checkbox selection
  • Select or Download Code