Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11761

    Hi there,

    the mails which are sent throughout the built-in contact form are full of HTML tags like br and strong. That doesn’t looks really good.

    Is there a fix?

    Thanx Holger

    #72943

    Hello,

    The contact form is using wp-mail.php outside of the theme and can be found on public_html via ftp.

    Best regards,

    Ismael

    #72944

    Hi,

    and there i have to edit the HTML of the mail?

    Thanx Holger

    #72945

    Hi Holger,

    It might be that your server isn’t allowing an email to be sent out with html tags in it and is converting it to plain text. Could you try using a plugin like Contact Form 7 or another that will allow you to test whether auto-generated html emals get the same weird formatting issue you are having.

    Thanks,

    Devin

    #72946

    I’m using Contact Form 7 in another blog. There everything looks fine.

    Thanks Holger

    #72947

    The only solution I can think of is to strip the html tags. Open up sentenceframeworkphpclass-form-generator.php and replace:

    $message .= $element['label'].": ".nl2br(urldecode($new_post[$key]))."<br/>";
    if($element['type'] == 'textarea') $message .= "<br/>";

    with:

    $message .= $element['label'].": ".nl2br(urldecode($new_post[$key]))."<br/>";
    if($element['type'] == 'textarea') $message .= "<br/>";
    $message = strip_tags($message);

    and:

    $message = nl2br($this->form_paramas['autoresponder'])."<br/><br/><br/><strong>Your Message:</strong><br/><br/>".$message;

    with:

    $message = nl2br($this->form_paramas['autoresponder'])."<br/><br/><br/><strong>Your Message:</strong><br/><br/>".$message;
    $message = strip_tags($message);

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘HTML tags in contact form mails’ is closed to new replies.