Back to Community

Troubleshooting Contact Form 7: Common Email Formatting and Character Issues

35 threads Sep 16, 2025 PluginContact form 7

Content

Contact Form 7 is a powerful and widely-used tool, but like any complex software, it can sometimes present challenges. A frequent area where users encounter problems is with email formatting and the handling of special characters. This guide will walk you through the most common issues reported by the community and provide clear, step-by-step solutions.

1. Emails Sending with Raw HTML Code or Incorrect Formatting

Many users report receiving emails that contain raw HTML code, unwanted blank lines, or a complete lack of formatting. This often manifests as the entire HTML structure, including the <head> and <body> tags, being visible in the email body.

Why this happens:

  • Plugin Conflict: A conflicting plugin can interfere with how Contact Form 7 constructs and sends emails. One specific plugin, 'WP Vulnerability', was identified in the threads as a direct cause of this issue.
  • Incorrect Content-Type Header: The email's Content-Type header may be incorrectly set to text/plain instead of text/html, causing the email client to display the HTML as plain text.

How to fix it:

  1. Conflict Test: The first and most crucial step is to perform a conflict test. Temporarily deactivate all other plugins except Contact Form 7 and switch to a default WordPress theme (like Twenty Twenty-Four). Test your form. If the emails send correctly, reactivate your plugins one by one to identify the culprit.
  2. Check Headers: Ensure the "Use HTML content type" box is checked in your Mail tab settings if you intend to send HTML emails.
  3. Review Code: Avoid using complex HTML structures like full HTML document templates (<!doctype html>, <html>, <head>) within your email body. Only use the necessary HTML tags for styling (e.g., <p>, <strong>, <table>).

2. Special Characters (Umlauts) Appearing Broken

After an update, users have found that special characters like German umlauts (ä, ö, ü) are replaced with garbled symbols like ������ in their emails.

Why this happens:

  • Server-Level Mail Control: In some cases, this is not a bug in Contact Form 7 but a server configuration issue. Certain web hosting control panels (like Plesk) have "Outgoing Mail Control" features that can corrupt the character encoding of multi-part messages.
  • Charset Declaration: The email may not be explicitly declaring its UTF-8 encoding.

How to fix it:

  1. Contact Your Host: If the issue started after a server update, contact your hosting provider. Reference the Plesk patch note (PPPM-14661) which fixed this exact problem, as it may guide their support team.
  2. Add Charset Meta Tag: If using HTML emails, add <meta charset="UTF-8"> inside the <head> tag of your email template. Note: This may not work if the issue is server-related.
  3. Check Header Differences: As noted in the threads, the Content-Type header changes when a file is attached (multipart/mixed vs. text/plain; charset=UTF-8). This can sometimes affect encoding. Testing without file uploads can help diagnose this.

3. Acceptance Field Always Shows "Accepted" in Email

A specific bug was reported where the acceptance checkbox field would always output "zugestimmt" (German for "accepted") in the email, regardless of whether the user checked the box or not.

Why this happens:

  • This was a confirmed bug in Contact Form 7 version 5.9.2. The plugin's code was incorrectly outputting the accepted text string without first verifying the field's state.

How to fix it:

  1. Update the Plugin: The Contact Form 7 team has acknowledged this bug and released a fix in a subsequent update. Simply ensure your Contact Form 7 plugin is updated to the latest version.

4. Line Breaks Not Showing in Email

When users enter text with line breaks in a textarea, the email renders it as a single block of text without any <br /> tags.

Why this happens:

  • By default, line breaks in plain text are not automatically converted to HTML line breaks (<br />) in HTML emails.

How to fix it:

  1. Use the wpautop Function: You can wrap your mail tag in the function that converts line breaks. In your email body, use {{{your-message}}} instead of just [your-message].
  2. Manual HTML: If you need precise control, instruct users to use HTML in their message or manage the conversion yourself with custom code.

General Troubleshooting Tips

  • Always Test for Conflicts: The vast majority of issues stem from conflicts with other plugins or themes. Deactivating all other plugins and using a default theme is the most reliable way to determine if Contact Form 7 itself is the source of the problem.
  • Check the Form Console: Use your browser's developer tools (F12) to check the JavaScript console for errors when submitting a form. Errors here can point to conflicts that break form functionality.
  • Review the Threads: The community forums are an excellent resource. Often, another user has already experienced your exact problem and found a solution.

By methodically working through these steps, you can resolve most common email formatting and character issues in Contact Form 7.

Related Support Threads Support