in reply to CGI recipient Option
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI recipient Option
by quissett (Initiate) on Sep 01, 2004 at 16:22 UTC | |
by ikegami (Patriarch) on Sep 01, 2004 at 16:24 UTC | |
by quissett (Initiate) on Sep 01, 2004 at 16:36 UTC | |
|
Re^2: CGI recipient Option
by Anonymous Monk on Sep 01, 2004 at 17:30 UTC |