<?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: wp_mail not sending inside gform function</title>
		<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function</link>
		<description>Gravity Support Forums Topic: wp_mail not sending inside gform function</description>
		<language>en-US</language>
		<pubDate>Sun, 03 May 2026 22:49:41 +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/wp_mail-not-sending-inside-gform-function" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44802</link>
			<pubDate>Thu, 22 Dec 2011 12:31:58 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44802@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Awesome! Merry Christmas. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44789</link>
			<pubDate>Thu, 22 Dec 2011 07:53:31 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">44789@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have fixed it guys, thanks for your awesome support as usual and Merry Christmas!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44787</link>
			<pubDate>Thu, 22 Dec 2011 07:33:04 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44787@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Tom Tong,&#60;/p&#62;
&#60;p&#62;Try moving your wp_mail() call to the top of the function. Also, are you working with WP_DEBUG set to true? That might give your a warning as to what is going on.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44784</link>
			<pubDate>Thu, 22 Dec 2011 06:26:02 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">44784@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks guys,&#60;br /&#62;
@david, your code works on my site perfectly, this is very strange. Everything in the function i posted works EXCEPT for the email side of things, yet your function works fine. I can't figure this at all!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44755</link>
			<pubDate>Wed, 21 Dec 2011 20:15:12 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">44755@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Tom,&#60;/p&#62;
&#60;p&#62;I tested this with the following code without issue:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/3054943&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/3054943&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Could you do the same and let me know?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44729</link>
			<pubDate>Wed, 21 Dec 2011 17:19:54 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">44729@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm not entirely sure. I'm not aware of any issues with using wp_mail() this way but I'll pass this along to one of our developers who will respond back.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44664</link>
			<pubDate>Wed, 21 Dec 2011 09:50:11 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">44664@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;just so you know, even if I add in wp_mail('my@email.com','test','test') at the end of the function it still won't work
&#60;/p&#62;</description>
		</item>
		<item>
			<title>adomedia on "wp_mail not sending inside gform function"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/wp_mail-not-sending-inside-gform-function#post-44658</link>
			<pubDate>Wed, 21 Dec 2011 08:48:38 +0000</pubDate>
			<dc:creator>adomedia</dc:creator>
			<guid isPermaLink="false">44658@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there any reason why wp_mail would not work inside this function?&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_action(&#38;quot;gform_after_submission_25&#38;quot;, &#38;quot;replymessage&#38;quot;, 10, 2);
function replymessage($entry,$form) {
	global $current_user;
	$message = array(
	&#38;#39;post_title&#38;#39; =&#38;gt; &#38;#39;ref#&#38;#39;.$current_user-&#38;gt;ID,
	&#38;#39;post_type&#38;#39; =&#38;gt; &#38;#39;message&#38;#39;,
	&#38;#39;post_status&#38;#39; =&#38;gt; &#38;#39;publish&#38;#39;,
	&#38;#39;post_author&#38;#39; =&#38;gt; $current_user-&#38;gt;ID
	);
	$post_id = wp_insert_post($message);
	add_post_meta($post_id,&#38;#39;ecpt_messagecontent&#38;#39;,$entry[&#38;#39;1&#38;#39;]);
	add_post_meta($post_id,&#38;#39;ecpt_messagestatus&#38;#39;,&#38;#39;unread&#38;#39;);
	add_post_meta($post_id,&#38;#39;ecpt_messagerecipient&#38;#39;,$entry[&#38;#39;2&#38;#39;]);
	add_post_meta($post_id,&#38;#39;ecpt_messagereply&#38;#39;,$entry[&#38;#39;3&#38;#39;]);

	//update post as read
	update_post_meta($entry[&#38;#39;3&#38;#39;],&#38;#39;ecpt_messagestatus&#38;#39;,&#38;#39;replied&#38;#39;);
	wp_mail(get_user_meta($entry[&#38;#39;2&#38;#39;], &#38;#39;user_email&#38;#39;, true),&#38;#39;You have a new message from &#38;#39;.get_user_meta($current_user-&#38;gt;ID, &#38;#39;first_name&#38;#39;, true),$entry[&#38;#39;1&#38;#39;]);
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;I've tested wp_mail outside this function and it works fine???&#60;/p&#62;
&#60;p&#62;Could it be something to do with the order this action is being fired in?&#60;br /&#62;
everything else inside this function works fine except for the mail side of things&#60;br /&#62;
I had to do this this way so that the recipient never finds out the email address of the person sending the message&#60;/p&#62;
&#60;p&#62;Thanks in advance
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
