Title: Emails arrive as raw html code
Last modified: October 20, 2021

---

# Emails arrive as raw html code

 *  Resolved [dlali](https://wordpress.org/support/users/dlali/)
 * (@dlali)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/emails-arrive-as-raw-html-code/)
 * Dear Team,
 * Back when i set up the plugin (in September), the first couple of test emails,
   and live emails went out properly.
 * Recently however, the emails go out as raw html code.
 * I am using Post SMTP plugin, and i can see that Cart Abandonement hands the emails
   over to Post SMTP as plain/text. (Content-Type: text/plain; charset=UTF-8) I 
   am guessing this is what causes my HTML emailt to appear as pain text codes?
 * Do you think this might be might problem? Any way to make sure Cart Abandonement
   emailt go out as HTML?
 * THanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/emails-arrive-as-raw-html-code/#post-14990817)
 * Hello [@dlali](https://wordpress.org/support/users/dlali/),
 * Thank you for reaching out to us.
 * If you are using the SMTP plugin to send emails, then please check if there is
   an option to send the email in plain text?
 * Please make sure that you allow HTML through email and disable the sending plain
   text option from SMTP plugin settings.
 * Let us know how it goes.
 *  Thread Starter [dlali](https://wordpress.org/support/users/dlali/)
 * (@dlali)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/emails-arrive-as-raw-html-code/#post-14999331)
 * Hi,
    There was no option in the other pugin, i also wrote a query to them, waiting
   for answer.
 * Anyway, meanwhile i have solved this problem with a filter. If anyone interested(
   got it from Google search):
 *     ```
       // adding support for html emails
       add_filter( 'wp_mail_content_type','mycustom_set_content_type' );
   
       function mycustom_set_content_type() {
               return "text/html";
       }
   
       // also filter the password reset email for compatibility with the HTML format
       add_filter( 'retrieve_password_message', 'mycustom_retrieve_password_message', 10, 1 );
   
       function mycustom_retrieve_password_message( $message ) {
               $message = str_replace('<','',$message);
               $message = str_replace('>','',$message);
               $message = str_replace("\n",'<br>',$message);
               return $message;
       }
       ```
   
 * Tha password reset email filter may not be necessary, as in the woocommerce email
   settings it already supports html email for password reset.
 * Ticket can be closed. Though it would be nice to have a solution without a manual
   filter.
 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [4 years, 7 months ago](https://wordpress.org/support/topic/emails-arrive-as-raw-html-code/#post-15001787)
 * Hello [@dlali](https://wordpress.org/support/users/dlali/),
 * We are glad that your issue has been resolved.
 * If you have any questions, please feel free to open a new ticket.
 * Have a great day ahead.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Emails arrive as raw html code’ is closed to new replies.

 * ![](https://ps.w.org/woo-cart-abandonment-recovery/assets/icon-256x256.gif?rev
   =3370405)
 * [Cart Abandonment Recovery for WooCommerce – Recover Lost Sales with Automated Emails](https://wordpress.org/plugins/woo-cart-abandonment-recovery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-cart-abandonment-recovery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * Last activity: [4 years, 7 months ago](https://wordpress.org/support/topic/emails-arrive-as-raw-html-code/#post-15001787)
 * Status: resolved