Dear Perl Monks, I have a problem that needs your wisdom and urgent help... I've tried to create a web based CGI form that should sends out emails to multiple email addresses when one, or multiple checkbox(s) is selected. It works fine when one checkbox is selected, but when more than one is selected it does not work. If you check more than one box, it won't send to anyone because it wouldn't be equal to 'Email_Group1' for example.. it would be equal to something like 'group1@domain.com - group2@domain.com' if both of those checkboxes where checked. Please let me know how to make the script be able to send out to one, or multiple email address if one or more checkboxes are selected. I have not been able to resolved this for a couple of days now and have come to a dead end. Thanks so much! Below is an example of the cgi code...
if($in{'chkboxname1'} eq 'Email_Group1'){ $in{'form-to'} = 'group1@domain.com'; } if($in{'chkboxname2'} eq 'Email_Group2'){ $in{'form-to'} = 'group2@domain.com'; } if($in{'chkboxname3'} eq 'Email_Group3'){ $in{'form-to'} = 'group3@domain.com';

In reply to CGI/PERL email form that will send to multiple address based on checkbox selection by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.