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.


Top ↑

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.

Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More