Skip Navigation

[Closed] Toolset forms routes notification emails to local server when it should not

This support ticket is created 2 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 replies, has 2 voices.

Last updated by patrickM-3 2 years, 10 months ago.

Assisted by: Nigel.

Author
Posts
#2301605

I have stripped a website down to only the 2022 theme and plugins WP Mail SMTP, Toolset Types & Toolset Forms. I have configured the domain to use an external mail server (Gmail). I have tested WP Mail SMTP and confirmed that it is sending mail through Google's mail servers correctly.

I have created a new form and new notifications and the behavior is the same. The sender for the emails is always the reverse DNS of the hosting system. The emails are all routing to the local server using address 127.0.0.1 THIS IS WRONG.

Toolset Forms should be sending email through whatever SMTP server is configured for WordPress NOT JUST USING LOCALHOST. All email sent to localhost is received and, because the local server is not the email server for the domain, the messages are immediately deleted.

how can you allow this to be so bad? There is really no excuse for this glaring mistake in your software. FIX THIS NOW or I will abandon Toolset and remove all of my clients. I will NEVER AGAIN USE OR RECOMMEND THIS PRODUCT.

#2301935

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Toolset Form notifications are just sent using the built-in WordPress wp_mail function, it doesn't have any kind of bespoke function to send emails.

I've been looking into this all morning, testing notifications with the plugin (which I confirm don't work).

This is the line in our plugin code responsible for sending the message:

$isSend = wp_mail($to, $subject, $body, $header);

(wp_mail is a core WP function: https://developer.wordpress.org/reference/functions/wp_mail/)

I don't know when or how the WP Mail SMTP plugin intervenes in the process, but that wp_mail call returns true (i.e. the mail is dispatched successfully). What happens after it is is out of our hands.

I even ran Xdebug to step through the code and step into the core wp_mail function to follow what happens, and it ultimately arrives at this line:

$send = $phpmailer->send();

...which also returns true (i.e. reports that the mail is dispatched successfully).

I can't account for what WP Mail SMTP does that breaks this.

But I did try an alternative SMTP plugin, Post SMTP (https://wordpress.org/plugins/post-smtp/), and I'm pleased to report that the notifications are sent fine in that case.

So I suggest you switch your SMTP plugin to use Post SMTP. (If you want to continue with WP Mail SMTP you may want to contact their support for help, being sure to mention that Toolset Form notifications work successfully with Post SMTP.)

Also, I recommend updating the notification settings of your form to use the same From address as your SMTP provider (in my case I was using Gmail).

#2302241

It Works!

#2302243

Thank you for this. This bug must be in WP Mail SMTP. I dropped $60 on that damn thing. I will rain abuse on them. I can't thank you enough for finding this. It's an obscure problem.

The topic ‘[Closed] Toolset forms routes notification emails to local server when it should not’ is closed to new replies.