wp_mail_charset WordPress Filter Hook

This hook allows you to change the charset used for sending emails through the wp_mail function. By default, the charset is set to UTF-8, but you can change it to something else by using this hook.

apply_filters( 'wp_mail_charset', string $charset ) #

Filters the default wp_mail() charset.


Parameters

$charset

(string)Default email charset.


Top ↑

More Information

  • The default character encoding for wp_mail() is UTF-8. The character encoding can be changed using the wp_mail_charset filter.
  • While the average user is unlikely to need to change the default character encoding for email, users who need to send email in different languages may find this filter useful.
  • UTF-8 is still the recommended default character encoding to use since it’s backward compatible with ASCII and can represent nearly all languages. As a result, UTF-8 is the most ubiquitous character encoding being used on the web. Users/developers typically do not need to change the character encoding in order to read/write foreign langauges.
  • As of Version 3.5, WordPress character encoding is no longer configurable from the Administration Panel and defaults to UTF-8.

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