Skip Navigation

[Resolved] Form notifications not sent when using WP Mail SMTP

This support ticket is created 4 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 56 replies, has 2 voices.

Last updated by helenmaryC 4 years, 9 months ago.

Assisted by: Beda.

Author
Posts
#1274691

I can't seem to re-open the old thread (with same title) on this issue so I am starting a new one.

I now have a test site set up and will provide the credentials below. I have an extra layer of security on wp-login which won't fit below. Can you send me a link to provide it.

The test site does the same thing that the production site did. If I create a user with the form when error logging is enabled, the notification is sent. If logging is disabled, the notification is NOT sent. Which makes troubleshooting a real challenge!

The form is Add User. The page that the form is on is Site Administration -> Data Export ->Add Member

Thanks.

#1274861

We can try logging the error instead of only returning it (add define('WP_DEBUG_LOG', true); to the wp-config.php, just after define('WP_DEBUG', true);
That might help catch the error in the error log generated if there is one, which I doubt.
https://toolset.com/documentation/user-guides/debugging-types-and-views/

Usually enabling error logging would trigger errors to appear that may not appear if disabled, but surely they will not hide errors that are happening if disabled, so I have not much hope for any error logged.

The Second step would be to see this happening on the site, I have for this purpose added a private reply, you can use to submit the server login details required to access the actual WP Login.
I'll then according to your description locate the page/form and try to send emails, hence, submit the form (Create users).
I hope this is OK, please mention if I cannot make any change or action on the site.

#1274909

Thanks, Beda.

The other credentials are as shown above.

This is a test site, duplicated from the production site, so feel free to make any changes you need to. The FTP access is directly to the folder containing the test site.

#1274911

I've removed the access as it seems you deselected the private reply?
However, I saved it to my notes and could access the website.

But the login details for the WordPress return "ERROR: Incorrect Username or Password 2 attempt(s) left"

Can you review those?
I re-enabled a fully private reply...

#1274913
#1274915
#1274927
#1275855

Did you guys manage to get into the test site, or do you need for me to do something else?

#1276369

I was on my weekend, I apologise for the delay.

Whether with wp debug set to true or false, the form at hidden link always sends the email just fine, as seen in the Logs at hidden link
The "Again again" and "test test" are the ones I sent, once with Debug set to true and once to false, at which I left it, in the wp-config.php

Can you show me how and where the issue happens?
Also, we will need to exclude other software if this still happens, could you (since it's a test site) remove all Plugins but Toolset?
We can then reactivate to see what causes it, however, I saw no issue so far - I might miss a detail.

#1276469

No problem. I just wanted to make sure you could get in. I hope you had a restful weekend!

Yes, I know that the emails always show up in WP Mail log as having been sent. They also appear in my gmail account's Sent Mail if I send with <b>logging turned on</b> and I receive them at the new account email. When <b>logging is turned off</b>, the email never shows up in Sent Mail or is received by the new account.

I also tried putting the form on a non-Elementor page (page name is A Test) and the email showed as sent in WP Mail Log, appeared in Sent Mail, and was received by the new account. leading me to believe that it was a conflict with Elementor. Which was how we got to turning on logging, hoping to figure out where the error was.

It almost seems to me as if there is some interaction between the form and Elementor that is causing the email to be malformed in a way that causes a conflict with the SMTP server, Though why logging the error would have an impact on that makes no sense to me.

Very strange!

#1276501

But I turned logging on and off, and the email was sent both times, as elaborated here:
https://toolset.com/forums/topic/form-notifications-not-sent-when-using-wp-mail-smtp-2/#post-1276369

However, my initial belief also was Elementor conflicts as we had this precise issue in past:
https://toolset.com/forums/topic/user-notification-does-not-get-sent/
But, that is resolved some time ago, and given I could see the mail sent in the log then not receiving the email must be due to something else, as the log shows the mails sent it must be after this (hence, maybe an inbox filter in the receiving part).

Strange, sure, that this solves with disabling/enabling wp debug, which I cannot really put into a specific place of known issues.
I could however as elaborated also not confirm this - the mail was sent always.

The WP Mail logging plugin is not logging emails if there is none sent. Hence it's the receiver, I assume, or other filters applied after the mail is sent by Forms.

Maybe we can try with fewer plugins and confirm simple forms work?
I can set up some tests forms on the site you shared, if this is fine?

#1276557

"then not receiving the email must be due to something else, as the log shows the mails sent it must be after this (hence, maybe an inbox filter in the receiving part)."

I would think it was something at the receiver, too, if it weren't for the fact that when the email isn't received, it also doesn't appear in Sent Mail for the outgoing email account on the gmail server. The disconnect seems to be somewhere between WP Mail SMTP and the gmail SMTP server, but since it only breaks under certain circumstances, it most likely is something in the formation of the email itself that is causing it to fail. Bad header, perhaps?

Feel free to do anything you need to the test site. That is what it is there for!

Thanks for sticking with this!

#1276837

I posted a question on the support board for WP Mail SMTP to see if they have any insights. I will let you know if they come up with anything.

#1277285
#1279617

I was out of town for 2 days so I am just getting back to this.

info@crfcrc.com is a gmail suite account that is only used to send email from the website and for incoming administrative stuff. I can look at the incoming and outgoing mail by signing into the account on gmail.

You said:

"I just created a new test user and used my personal email s.mail.beda@gmail.com and I do receive the email just fine.
I did not receive the email even the debug is set to false in wp-config, but WP Mail logger logs it as sent."

This confused me, because when I look at the outgoing mail for info@crfcrc.com there is no email to you, just one to more@more.com that got an Outlook bounce message back.

Also, you said: (an aside, can you get your webmaster to allow <quote></quote> tags in replies? It would make the threads easier to format and read!)

"Can you make it so the Form sends emails without requirements of any other plugin on this site?"

I will see about setting this up and let you know when it is ready. May take a day or two as I get caught up.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.