wp_mail_from WordPress Filter Hook

wp_mail_from is a Wordpress hook that allows you to change the from email address for outgoing emails. This can be useful if you want to use a different email address for your Wordpress site, or if you want to make sure that outgoing emails are coming from a specific address.

apply_filters( 'wp_mail_from', string $from_email ) #

Filters the email address to send from.


Parameters

$from_email

(string)Email address to send from.


Top ↑

More Information

  • The wp_mail_from filter modifies the “from email address” used in an email sent using the wp_mail() function. When used together with the ‘wp_mail_from_name‘ filter, it creates a from address like “Name”. The filter should return an email address.
  • To avoid your email being marked as spam, it is highly recommended that your “from” domain match your website.
  • Some hosts may require that your “from” address be a legitimate address.
  • If you apply your filter using an anonymous function, you cannot remove it using remove_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.