apply_filters( 'wp_mail_content_type', string $content_type )

Filters the wp_mail() content type.

Parameters

$content_type

(string) Default wp_mail() content type.

More Information

  • The default content type for email sent through the wp_mail() function is ‘text/plain‘ which does not allow using HTML. However, you can use the wp_mail_content_type filter to change the default content type of the email.
  • In general, content type is going to be ‘text/plain‘ as the default, or ‘text/html‘ for HTML email; but other MIME types are possible.

Source

File: wp-includes/pluggable.php

View on Trac

Changelog

Version Description
2.3.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/wp_mail_content_type