Khurram Shaikh
Khurram Shaikh

Reputation: 300

Wordpress wp_mail is not sending HTML email

I have an email issue in WordPress woo-commerce email. it is sending an email using a header plain text email.

X-Mailer-Type:WPMailSMTP/Admin/Test 

when I try to send an HTML formatted email using the below header it's not sending. However, both emails are logging in to WP Mail Logging.

Content-Type: text/html; charset=UTF-8  

I had tried to disable possible security plugins and Spent hours until I found this issue. any WordPress expert developer please help.

Upvotes: 0

Views: 742

Answers (1)

Leonardo Feriato
Leonardo Feriato

Reputation: 81

You can try add this filter in your theme's functions.php or plug-in code

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

Credits: https://wordpress.stackexchange.com/questions/27856/is-there-a-way-to-send-html-formatted-emails-with-wordpress-wp-mail-function

Upvotes: 1

Related Questions