Email sent from WordPress has HTML tags

The default content type is 'text/plain' which does not allow using HTML. You can set the content type of the email by including a header like “Content-type: text/html”

$headers="Content-type: text/html;charset=utf-8" . "\r\n";
$headers .= 'From: XXXXXX.com <[email protected]>' . "\r\n";
   $subject="Registration from xxxxx.com" . "\r\n"; 
   $message = $result_email_text;
   wp_mail($_POST['admin_email'], $subject, $message, $headers );

Or you can set it by using the wp_mail_content_type filter

remove_filter( 'wp_mail_content_type', 'set_html_content_type' );
add_filter( 'wp_mail_content_type', 'set_html_content_type' );
function set_html_content_type() {

    return 'text/html';
}

For more detail see the following link:
http://codex.wordpress.org/Function_Reference/wp_mail

Leave a Comment