<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: How to override wp_mail_from filter</title>
		<link>https://legacy.forums.gravityhelp.com/topic/how-to-override-wp_mail_from-filter</link>
		<description>Gravity Support Forums Topic: How to override wp_mail_from filter</description>
		<language>en-US</language>
		<pubDate>Wed, 08 Apr 2026 11:04:07 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/how-to-override-wp_mail_from-filter" rel="self" type="application/rss+xml" />

		<item>
			<title>SigarettDesign on "How to override wp_mail_from filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-override-wp_mail_from-filter#post-46285</link>
			<pubDate>Fri, 13 Jan 2012 11:09:43 +0000</pubDate>
			<dc:creator>SigarettDesign</dc:creator>
			<guid isPermaLink="false">46285@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I would love to have a more precise description of how you solved this, LumpySimon. I did as you suggested and made my own custom function but nothing changes with Gravity Forms.&#60;/p&#62;
&#60;p&#62;Looking forward to your reply.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Eivind
&#60;/p&#62;</description>
		</item>
		<item>
			<title>LumpySimon on "How to override wp_mail_from filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-override-wp_mail_from-filter#post-26304</link>
			<pubDate>Wed, 25 May 2011 13:26:35 +0000</pubDate>
			<dc:creator>LumpySimon</dc:creator>
			<guid isPermaLink="false">26304@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There turned out to be a simple way to do it: the wp_mail function is pluggable, so I've just copied the entire function but changed the lines that set the default address to use the admin_email and blogname functions.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "How to override wp_mail_from filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-override-wp_mail_from-filter#post-26289</link>
			<pubDate>Wed, 25 May 2011 11:16:10 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">26289@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;There isn't anyway to do this from Gravity Forms as it simply calls the wp_mail function to execute sendmail functions.  You would have to check with the WordPress CODEX or possibly one of the core WordPress developers to see if it's possible, i'm not aware of any specific way to do this.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>LumpySimon on "How to override wp_mail_from filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/how-to-override-wp_mail_from-filter#post-26279</link>
			<pubDate>Wed, 25 May 2011 10:51:31 +0000</pubDate>
			<dc:creator>LumpySimon</dc:creator>
			<guid isPermaLink="false">26279@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi&#60;/p&#62;
&#60;p&#62;I'm using the wp_mail_from and wp_mail_from_name filters so that all WordPress emails come from &#34;My Site&#34; &#38;lt;email@example.com&#38;gt; (rather than the default non-existent &#38;lt;wordpress@example.com&#38;gt; address).&#60;/p&#62;
&#60;p&#62;However, this filter is also overriding all my notifications sent by Gravity Forms.&#60;/p&#62;
&#60;p&#62;Is there a conditional test I can add to the filter function so that it doesn't run if the email is being sent by Gravity Forms?&#60;/p&#62;
&#60;p&#62;Here's the code I'm using:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter( &#38;#39;wp_mail_from&#38;#39;, &#38;#39;send_mail_from&#38;#39; );
add_filter( &#38;#39;wp_mail_from_name&#38;#39;, &#38;#39;send_mail_from&#38;#39; );

function send_mail_from() {
	return get_option( &#38;#39;wp_mail_from&#38;#39; == current_filter() ? &#38;#39;admin_email&#38;#39; : &#38;#39;blogname&#38;#39; );
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Many thanks&#60;br /&#62;
Simon
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
