Try this one.
add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
$to = '[email protected]';
$subject="The subject";
$body = 'The email body content';
$headers = array('Content-Type: text/html; charset=UTF-8');
wp_mail( $to, $subject, $body , $headers);
// Reset content-type to avoid conflicts -- https://core.trac.wordpress.org/ticket/23578
remove_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' );
function wpdocs_set_html_mail_content_type() {
return 'text/html';
}
Related Posts:
- HTML email sent with wp_mail shows plain text
- Can I set subject/content of email using mailto:?
- Include HTML template file in wp_mail
- WP mail sent to MS Exchange recipients = occasional email corruption?
- Images in wp_mail not showing
- Programming WordPress to send a custom-built form to specified email address
- Use Mail-Tag from Contac Form 7 in a script
- get_post_meta is always empty when I use wp_mail
- Unblur content inside blurring background div
- What character encoding is >?
- Setting table column width
- What is difference between png8 and png24
- How can I set the default value for an HTML
- the use of `%3F` in URL
- Tab space instead of multiple non-breaking spaces (“nbsp”)?
- My website doesn’t work in I.E. (but does in chrome and firefox)
- Onclick javascript to make browser go back to previous page?
- Best way to encode Degree Celsius symbol into web page?
- How to place a text next to the picture?
- How do you create a hidden div that doesn’t create a line break or horizontal space?
- Is it possible to get a list of files under a directory of a website? How?
- AngularJS ngClass conditional
- How to darken a background using CSS?
- How to solve PHP error ‘Notice: Array to string conversion in…’
- Hiding a button in Javascript
- How to display and hide a div with CSS?
- Get HTML code using JavaScript with a URL
- Change Color of Fonts in DIV (CSS)
- Why is “cursor:pointer” effect in CSS not working
- a href link for entire div in HTML/CSS
- How to read if a checkbox is checked in PHP?
- Definition of ui-sref in Angular.js?
- mailto using javascript
- Complete list of reasons why a css file might not be working
- How to submit a form with JavaScript by clicking a link?
- Brackets – Live Preview not working
- CSS set li indent
- Why does this CSS margin-top style not work?
- How to do auto-width with HTML IFrame
- Freeze the top row for an html table only (Fixed Table Header Scrolling)
- HTML list-style-type dash
- Bootstrap throws Uncaught Error: Bootstrap’s JavaScript requires jQuery
- How can I make my footer center to the bottom of the page?
- “AutoComplete=Off” not working on Google Chrome Browser
- Why would max-width not work on this?
- Making text background transparent but not text itself
- Square brackets in CSS
- Scraping data from website using vba
- body background color not showing?
- How to make my website fit any screen size?
- Display:inline not working
- Bootstrap 3 Glyphicons CDN
- top align in html table?
- SVG drop shadow using css3
- How do I change the default index page in Apache?
- Force table column widths to always be fixed regardless of contents
- Colspan all columns
- Change the color of glyphicons to blue in some- but not at all places using Bootstrap 2
- Using Numbers With Font Awesome
- single line comment in HTML
- Is there a way to bookmark or link to a section of a page without an anchor?
- Copying HTML code in Google Chrome’s inspect element
- how do I get the bullet points of a
- to center with the text?
- CSS: Can a div “float:middle” rather than “float:left;” with margin-left?
- How to escape html code with html allowed
- How to Embed HTML files directly into WordPress
- Send batch of posts as HTML Email?
- Thumbnail + Excerpt = loss in word count
- If new comment posted in custom post – send notification to custom email from custom field
- How do I call wp_mail from HTML?
- How do you get words to show up at the bottom instead of beside a left-aligned photo? [closed]
- Migrating content from an old solution. How to easily change hardcoded hyperlinks in legacy content
- Email ‘from address’ has a www in it
- Embed tag length issues
- How put links in wordpress dynamic sidebar?
- How to add a class to the element?
- WordPress editor not creating tags properly in tables
- How do I make HTML output work when using the customizer?
- Sending HTML emails via wp_mail not working properly
- What doctype is considered best practice to use for WordPress?
- Remove tags from wordpress head
- Help with filter for wp_notify_moderator()
- render html no formatting
- hyphenation not working in Gutenberg editor
- Pass return-path additional parameter in wp_mail
- product description text displays above website when in shop page [closed]
- All wordpress site went white blank screen
- WordPress new user email formatting issues
- Why is WordPress swapping double quotes (“) to curly quotes (“) and how do I stop it from happening?
- Display GIF as Facebook link thumbnail
- Updated : how to make email optional while user registration using default wordpress form
- Change rel=”noopener noreferrer” to rel=’noopener noreferrer’ (single quote)
- How to add an ID to an existing HTML element?
- Open popup automatically when navigate to the page id
- Wp_mail doesnt work
- Displaying html table on post content
- What are the WordPress’ pre-formatted html components?
- can’t update plugins or wordpress or install new plugins [duplicate]
- How can I add a google play badge to my header and footer?
- Post title appears twice in browser title bar