wp_mail WordPress Filter Hook

The wp_mail function is used to send emails from a WordPress site. This function is used by many plugins and themes to send notifications and other information to users. The wp_mail function can be used to send any type of email, including HTML emails.

apply_filters( 'wp_mail', array $args ) #

Filters the wp_mail() arguments.


Parameters

$args

(array)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.


Top ↑

More Information

  • The wp_mail filter hook allows you to filter the arguments that are passed to the wp_mail() function. The arguments for wp_mail() are passed through the filter as an array.
  • $attachments should be an array. If it is not, it will be converted to one by the wp_mail function after the filter.

Top ↑

Source

File: wp-includes/pluggable.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.2.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