wp_mail_content_type WordPress Filter Hook
The wp_mail_content_type hook allows you to modify the content type of the email being sent by Wordpress. This can be useful if you want to send HTML emails or if you want to change the encoding of the email.
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 thewp_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
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |