in reply to CGI / Perl form to email from input field.
before the fisrt if($in{'ChkboxName1'}){ or if you ended up using chromatic's code you could do this:$in{'form-to'} .= $in{'inputf1'} if $in{'inputf1'};
LOL I can guess what the next question is too: Hello All, I have created a web form that uses CGI to process/format the data to send in the background. Now that I have written the code to collect the email addresses to email to I need to figure out what to do to send the emails... see code below: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 }; push @mail_addesses, $q->param('inputf-emailaddr') if $q->param('inpu +tf-emailaddr'); my $to = join(', ', grep { defined } @mail_addresses );
=))$in{'form-to'} .= $in{'inputf1'} if $in{'inputf1'}; if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup1@Domain.com'; } if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup2@Domain.com'; } if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup3@Domain.com'; } $in{'form-to'} =~ s/^,//;
|
|---|