Hello All, I have created a web form that uses CGI to process/format the data to send in the background. With the help of some the Perl monks on this site I was able to get the form to send emails out based on Checkbox selection. Is there a way to also send out the email also based on text input. Let say I want to add an additional field call 'Optional email', this will be a text input, the user, if they want to send out addional emails to a user not part of the pre-defined checkbox field, they can manually type in the SMTP address and the form will parse or send it along with the selected checkbox... I don't know if this will work, but I know there's a way to do this. I was able to get this to work with the email (checkbox) selection, so what an addional input field.. Please help...thanks in advanced.

Below is a sample of some of the fields in my form.

SMTP group 1 : checkbox (this will send out to SMTP address if selecgted)
SMTP group 2: checkbox (this will send out if selected)
SMTP group 3: checkbox (this will send out if selected)
Optional Email to sendout: < input field > - this is what I want to add, if a user puts in an additonal SMTP address, this form will also send it to that address, along with the selected checkboxes....

if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup1@Domain.com'; } if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup2@Domain.com'; } if($in{'ChkboxName1'}){ $in{'form-to'} .= ',EmailGroup3@Domain.com'; } $in{'form-to'} =~ s/^,//;

In reply to CGI / Perl form to email from input field. 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.