in reply to Re: Re: Re: form recipients
in thread form recipients

ARDEN, Thank you again for your help. I have tried a few things and everytime I make some changes it does not recognize the CGI when I submit the form. As mentioned above, how do I declare the values of the check boxes before the open(mail..? Thanks in advance.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: form recipients
by iburrell (Chaplain) on Mar 11, 2004 at 00:58 UTC
    Before you open the pipe to sendmail but after parsing the CGI query into %FORM, you need to change the $recipients based on the checkbox value:
    if ($FORM{'chkno'}) { $recipients .= " foo@example.com"; } <code> Then, the command will look like: <code> |/usr/lib/sendmail yogibear@test.edu foo@example.com
    The To: line needs to have commas separating the addresses instead of spaces.
    To: yogibear@test.edu, foo@example.com
    Finally, you need to add a blank line between the end of the headers and the start of the HTML.
    print MAIL "Content-Transfer-Encoding: 7bit\n"; print "\n"; print MAIL "<html><head>\n";