Back to Home: PHP FormMail Generator I Need Help : Ask Question Without Registration

Use web form to send emails to CC or BCC based on the input value of form field
  • admin September 2011
    Question :

    I've been using your PHP Form Creator very successfully for several months now on many projects.

    After implementing my latest form, it was brought to my attention that
    it would be useful when filling out the form to be able to CC 1 or more
    people when the form is completed.

    I setup the generic email field, but I don't know how to convert it to the PHPFMG_CC.

    How do I this and where do I put the code?

    Answer :

    Instead of using predefined value for email's CC or BCC field, the web form can use a dynamic field value input by user. Here are the steps :
    1) get the field name or field ID of the field from form.php, let's use "field_1" as example.

    2) then change one line code in form.lib.php as following :
        define( 'PHPFMG_CC' , phpfmg_field_value('field_1') );

    3) upload the form.lib.php back to your website to test the form mail

    See the screen shot below for details:


    For the dynamic email TO field, please read here : Can a form send email to a different email address depends on dropdown options?
    formmail-cc-bcc-options.jpg 196K