Support » Plugin: Jetpack - WP Security, Backup, Speed, & Growth » Form mail – mail in text/plain

  • Resolved tomse

    (@tomse)


    I’ve tried to figure out how to get the forms in jetpack to send in text/plain.

    I’ve found several locations where people ask to convert from plain to html using the code in functions.php

    function wp_set_mail_plaintext() {
        return 'text/html';
    }
    add_filter( 'wp_mail_content_type', 'wp_set_mail_plaintext' );
    

    Of course I’ve tried

    
    function wp_set_mail_plaintext() {
        return 'text/plain';
    }
    add_filter( 'wp_mail_content_type', 'wp_set_mail_plaintext' );

    which didn’t result in what I wanted.

    I still see html in the body of my received mails.

    snippet of the mail source

    This is a multi-part message in MIME format.
    
    --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--
    Content-Type: text/plain; charset=us-ascii
    
    Name: my name
    
    Email: <email>
    
    ----
    Time: 27. oktober 2020 at 20:20
    IP Address: 10.0.0.100
    Contact Form URL: https://<my form>
    
    Sent by a verified "<site>" user.
    
    Content-Type: text/html; charset=us-ascii
    
    <!doctype html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <body>
    
    <b>Name:</b> <myname><br /><br /><b>Email:</b> <myemail><br /><br /><br /><hr />Time: 27. oktober 2020 at 20:20<br />IP Address: 10.0.0.100<br />Contact Form URL: <site><br /><p>Sent by a verified "<site>" user.</p>
    
    </body>
    </html>
    
    --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--
    • This topic was modified 1 month ago by tomse.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.