I'm not sure I understand what you want, but I believe it's one of these:
1) Emailing works, but you want to change the recipient depending on a checkbox. Add:
$recipient = 'test@test.edu' if ($FORM{'ckusno'});
2) Emailing works, but you want to send the email to two recipients depending on a checkbox. Put the mail stuff in a subroutine and call it twice:
$recipient2 = 'test@test.edu'; sub mail_it { my ($to) = @_; open (MAIL, "|$mailprog $to") || die "Can't open $mailprog!\n"; print MAIL "Reply-to: $FORM{'espr2'} $FORM{'estb'} $FORM{'espr'}\n" +; print MAIL "MIME-Version: 1.0\n"; print MAIL "To: $to\n"; ... print MAIL "</body></html>"; close (MAIL); } mail_it($receipient); mail_it($receipient2) if ($FORM{'ckusno'});
In the future, please specify what it does wrong, not just what you want it to do.
In reply to Re: CGI recipient Option
by ikegami
in thread CGI recipient Option
by quissett
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |