WordPress.org

Ready to get started?Download WordPress

Codex

Plugin API/Filter Reference/wp mail charset

Contents

Description

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.

Parameters

$charset
(string) (required) The email character encoding
Default: UTF-8

Examples

The following will filter the character encoding to UTF-32

add_filter( 'wp_mail_charset', 'change_mail_charset' );
function change_mail_charset( $charset ) {
	return 'UTF-32';
}

Notes

As of Version 3.5, WordPress character encoding is no longer configurable from the Administration Panel and defaults to UTF-8.

Change Log

Since: Version 2.3

Source Files

wp_mail_charset is located in wp-includes/pluggable.php

Related