• Resolved ntufnel

    (@ntufnel)


    Hi there. Since upgrading to the new version of Contact Form (with the validator), I am getting a “This field has syntax errors” message on the Additional Headers field of several of my forms.

    The common element is that each of these fields uses a bcc: header and also uses a checkbox to generate input for the bcc (so that the user can check multiple checkboxes on the form and the form will bcc itself to the email addresses in the checked checkboxes.

    Here is an excerpt of the form:

    [checkbox bcc-email "First Address | [email protected]" "Second Address | [email protected]" "Third Address | [email protected]"]

    … and here is the header from the mail tab:

    Bcc: [bcc-email]

    The syntax error message goes away if I remove the variable substitution and just hardcode an email address like:
    Bcc: [email protected]

    Any ideas about what is wrong here? The emails still seem to process and send OK, just the validation message I am trying to get rid of.

    https://ww.wp.xz.cn/plugins/contact-form-7/

Viewing 2 replies - 1 through 2 (of 2 total)
  • You need to make the checkbox required(*) in the FORM, otherwise you are asking the form to send a bcc which may not have a recipient sent.

    [checkbox* bcc-email "First Address | [email protected]" "Second Address | [email protected]" "Third Address | [email protected]"]

    Thread Starter ntufnel

    (@ntufnel)

    That seems to do it — thanks TONS for the advice!!

    Although, as a minor aside for the devs of Contact Form 7, this behavior does not meet the behavior of bcc outlined in RFC 2822, which basically states that the bcc field can be present, but can be devoid of valid email addresses — a blank bcc is valid in an email header.

    The following text is from the RFC:

    Finally, since a “Bcc:” field may contain no addresses, a “Bcc:” field can be sent without any addresses indicating to the recipients that blind copies were sent to someone.

    Here’s a direct link – see sec 3.6.3

    Anyway, relatively minor issue — I’m on my way now. Thanks again for the help – it would have taken me a while to figure that out by myself.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Field Syntax Errors: bcc checkbox input’ is closed to new replies.