• Resolved mwarbinek

    (@mwarbinek)


    Reading about this syntax error, which I got on some sites and not on others and could not figure out what was causing an error when on other sites it worked fine.

    Example – Working on one site under Tab “Mail” and for “Additional Headers:

    Reply-To: [your-email]
    Telephone: [tel-123]

    Now going to another site, it did not work and got the red warning of an error

    Example – Not working on a second site

    Reply-To: [your-email]
    Telephone: [tel-456]

    I could not figure out why the difference. Then reading this entry here:

    Additional Headers invalid mailbox syntax

    When that post spoke of the “asterisk” beside the tag name, such as [email* your-email], that was the answer.

    This means we cannot insert any “additional headers” where the corresponding tag name does NOT have an asterisk included.

    Using the examples above, the tag names for email and tel MUST have an asterisk included in the settings under the Form tab, in order to insert the same tags in Additional Headers.

    Therefore, using the second example above, for those Additional Header entries to work, I must have the following under the Form Tab,

    [email* your-email]

    [tel* tel-456]

    Without the asterisk, entering any tag for Additional Headers will not work and the error will pop-up.

    Comment
    I see this as very important to know. When I view the Contact Form 7 support page that apparently tried to explain this (https://contactform7.com/configuration-errors/invalid-mail-header/), it failed to include the requirement of matching tag asterisk.

    This means people who view the support page with the same issue, will never figure out what is wrong when they follow the support page information exactly.

    I suggest that the Form 7 developer add that very important piece of information AND any other “important” information that is required for Additional headers to avert syntax errors.

    Basically, if you want to provide support information like that support page, write it for those who know very little about tags, WordPress, coding, etc. Always include the “required” information, such as, “All that is required to make it work“, as I have show above, the need for the “asterisk” is definitely a requirement for the Additional Headers to work.

    Are there other things required for Additional Headers to work, such as for more advanced settings?

    • This topic was modified 6 years, 3 months ago by mwarbinek. Reason: More info
    • This topic was modified 6 years, 3 months ago by mwarbinek. Reason: grammar fix
Viewing 6 replies - 1 through 6 (of 6 total)
  • AVSoffice

    (@avsoffice)

    Sadly, in my case, the suggestion of [email* your-email] didn’t work. I then tried: Reply-To: [email* your-email] Neither worked.

    Thread Starter mwarbinek

    (@mwarbinek)

    The setup above is based on how CF7 works and what it requires to work.

    If it did not work for you, means your setup is incorrect.

    Here is what I have and it works,

    == Under the “Form” Tab ==

    <label> Your Name (required)
    [text* your-name] </label>
    
    <label> Your Telephone (required)
    [tel* tel-507 placeholder "250-555-5555"]</label>
    
    <label> Your Email (required)
    [email* your-email] </label>
    
    <label> Website URL
    [url url-545 placeholder "domain-name.com"] </label>
    
    <label> Subject (required)
    [text* your-subject] </label>
    
    <label> Your Message (required)
    [textarea* your-message placeholder "Please provide all details for your request or inquiry"] </label>
    
    [submit "Send"]

    Then,

    == Under the “Mail” tab ==

    To: [email protected]
    From: [your-name] <[email protected]>
    Subject: Any text here: "[your-subject]"
    
    Additional Headers: 
    Reply-To: [your-email]
    Telephone: [tel-507]
    
    Message Body:
    From: [your-name] 
    Telephone: [tel-507]
    Email: [your-email]
    Website: [url-545]
    
    Subject: [your-subject]
    
    <div style="border-bottom: 1px solid #000;">Message Body:</div>
    [your-message]

    Comment:
    Take notice where the “*” is used above, and all short-codes that are used must match between the Form tab and Mail tab entries.

    puilu

    (@zconsulting)

    Hello facing same issue.
    here is my code can you update it for me and resend because when I add it it removes error but makes name and email fields uncompletable in the form front end.
    Here is my form tab codes:

    <div class=”row clearfix”>
    <div class=”col-md-6 col-sm-6 col-xs-12 form-group”>
    <input type=”text” name=”username” placeholder=”Name *” required>
    </div>
    <div class=”col-md-6 col-sm-6 col-xs-12 form-group”>
    <input type=”email” name=”email” placeholder=”Email *” required>
    </div>
    <div class=”col-md-6 col-sm-6 col-xs-12 form-group”>
    <input type=”text” name=”phone” placeholder=”Phone *” required>
    </div>
    <div class=”col-md-6 col-sm-6 col-xs-12 form-group”>
    <input type=”text” name=”subject” placeholder=”Subject” required>
    </div>
    <div class=”col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group”>
    <textarea name=”message” placeholder=”Message”></textarea>
    </div>
    <div class=”col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group”>
    <button class=”theme-btn btn-style-one” type=”submit” name=”submit-form”>Submit Now</button>
    </div></div>

    Thread Starter mwarbinek

    (@mwarbinek)

    @zconsulting

    If you are putting that HTML code into the CF7 form settings, the form will not work because the required short-codes: [short-code] are missing.

    Is this what you are doing?

    puilu

    (@zconsulting)

    Thread Starter mwarbinek

    (@mwarbinek)

    @zconsulting

    It seems is you extracted the HTML code from the contact page expecting to have it fixed here because your contact form does not work.

    The Contact Form 7 HTML coding begins something like the following,

    <div role="form" class="wpcf7" id="wpcf7-f9999-p222-o1" dir="ltr" lang="en-US">

    …where the “ID” name starts as “wpcf7” and the rest of the number may vary between websites.

    The HTML code you posted here has no reference to Contact Form 7, so if it came with the theme, then the theme developer designed its own contact form.

    To have your contact form fixed, for the one created by the theme, you need to contact support for the theme.

    If you want to use Contact Form 7, you need to go to the Contact Page, remove the theme’s contact form and insert the Contact Form 7 short-code you see in it’s settings which looks like this,

    [contact-form-7 id="5678" title="Contact form 1"]

    …unless the theme has placed all settings for its contact form in its “Theme Options” which are separate from the Customizer.

    Essentially, the HTML code you posted for fixing has nothing to do with Contact Form 7, and even if it did, fixing the contact form is not using HTML code, it is either using Custom CSS (for styling only) or in the settings for the form which applies to its functioning.

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Additional Headers invalid mailbox syntax (Explained further)’ is closed to new replies.