WordPress at Your Fingertips
filter is not described

wp_mail filter-hook . WP 2.2.0

Filters the wp_mail() arguments.


add_filter( 'wp_mail', 'filter_function_name_2603' );
function filter_function_name_2603( $args ){
	// filter...

	return $args;

Array of the wp_mail() arguments.

  • to(string|string[])
    Array or comma-separated list of email addresses to send message.

  • subject(string)
    Email subject.

  • message(string)
    Message contents.

  • headers(string|string[])
    Additional headers.

  • attachments(string|string[])
    Paths to files to attach.


Since 2.2.0 Introduced.

Where the hook is called

wp-includes/pluggable.php 200
$atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );

Where in WP core the hook is used WordPress

wp-includes/default-filters.php 243
add_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );