html email writes invalid html
-
When using the “Use HTML content type” in the Mail tab CF7 runs wpautop() on everything entered into the Message Body field when sending the email.
This causes<html> <body> <p>A paragraph.</p> </body> </html>
to become
<p><html><br /> <body></p> <p>A paragraph.</p> <p> </body><br /> </html></p>
in the emails html source.
If the html and body tags are not added in the Message Body field of CF7 then<p>A paragraph.</p>
is sent unchanged in an email without html or body tags in the html source. Both of these email versions are invalid and each triggers a different Spam Assassin rule.
The only way I am able to send a valid html email is if I use the first version (with html and body tags) and comment out line 51 of contact-form-7/includes/mail.php// $body = wpautop( $body );
FEATURE REQUEST: May I request that the line 51 be wrapped in an IF condition and a checkbox be added below the Message Body field to disable the wpautop function.
if ($disable_wpautop === false) { $body = wpautop( $body ); }
- The topic ‘html email writes invalid html’ is closed to new replies.