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

That is too late. You need to check  $FORM{'ckusno'} BEFORE you  open(MAIL ... and alter the value of $recipients then. You can still re-use the variable in the body of the email message, but you need to know who to send the message to before you start to send the message.

- - arden.

Replies are listed 'Best First'.
Re: Re: Re: Re: form recipients
by Anonymous Monk on Mar 10, 2004 at 21:02 UTC
    How do you check the value prior to putting this in the body?
Re: Re: Re: Re: form recipients
by Anonymous Monk on Mar 10, 2004 at 21:35 UTC
    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.
      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";
Re: Re: Re: Re: form recipients
by togrady (Initiate) on Mar 10, 2004 at 21:37 UTC
    Sorry, The last questions was me, forgot to login.
Re: Re: Re: Re: form recipients
by togrady (Initiate) on Mar 10, 2004 at 19:10 UTC
    Arden, You will have to forgive me a little. I inherited this from our perl expert who has left our company. I am a .net programmer with little experience on the CGI front. I have managed to get the basics running but taking these a step further has proven to be a little bit of a challenge.