By default, wp_mail function does not support displaying formatted emails. For example, notifications of new comments that have formatted text shows HTML-tags displaying like a plain text.
I solved this problem by adding the following code to the functions.php file:
function set_html_mail_content_type(){
return "text/html";
}
add_filter( 'wp_mail_content_type','set_html_mail_content_type' );
After that, emails began to come with formatted text and without HTML tags.
But another problem appears. The whole email comes in continuous text: no new lines and no paragraphs: It’s just that all sentences are in a one row.
Do you have any idea what it might be related to?
I usually handle this by passing the content type in the headers parameter for
wp_mail()
For example...
More info here: https://developer.wordpress.org/reference/functions/wp_mail/
Hope this answers your question.