in reply to Re: CGI/PERL email form that will send to multiple address based on checkbox selection
in thread CGI/PERL email form that will send to multiple address based on checkbox selection

Tried the code, it works but only sends to the first email address if I select more than one. For some reason I doesn't know or / want to send to more than one email address if one or more check boxes are selected. Am I doing anything wrong? Thanks!
  • Comment on Re: Re: CGI/PERL email form that will send to multiple address based on checkbox selection

Replies are listed 'Best First'.
Re: Re: Re: CGI/PERL email form that will send to multiple address based on checkbox selection
by Grygonos (Chaplain) on Jun 18, 2003 at 16:06 UTC
    maybe try seperating the addresses by commas ie
    $address = "me@you.com, you@me.com";
    I know that's not the same format you're using but you see what I'm getting at. if your variable you're pushing onto is not empty then push a comma, and the address, otherwise just push the address.. I could be way off-base, but that's my two cents.
      actually you have the idea. But I don't think that would work because each group (checkbox on the form), has a seperate email associated to it. If you check only one, it shoud only send to the email associated to it, if you check more than one, then it should send to all email addresses that are associated to the checkboxes selected. Thanks!
Re: Re: Re: CGI/PERL email form that will send to multiple address based on checkbox selection
by ant9000 (Monk) on Jun 18, 2003 at 16:43 UTC
    Try and print the value of $in{'form-to'} of the version I suggested you: does it contain all of the required addresses? It should, as far as I can tell... so I'd suggest to check the code that actually sends the emails.