Skip Navigation

[Closed] CRED Form returning AJAX Request Failed!

This support ticket is created 4 years, 3 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 18 replies, has 2 voices.

Last updated by Jamal 3 years, 10 months ago.

Assisted by: Jamal.

Author
Posts
#1781499

Hi guys,

I am having exactly the same issue as described in this ticket: https://toolset.com/forums/topic/cred-form-returning-ajax-request-failed/

Unfortunately the ticket got closed without further development, so I'm kind of bumping this topic forward.

To sum it up. Suddenly my post form stopped sending email notifications. Tried custom SMTP mailer extensions without any success.

The test email feature works just fine.

Other contact form extensions work just fine.

Tried disabling the rest of the extensions - did not help.

Thanks in advance!

#1781565

Hello and thank you for contacting the Toolset support.

Please activate PHP debugging to spot any possible errors, they might help us understand the origin of this issue.
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/#php-debugging

If this does not help, we might need to take a copy of your website to debug it locally. We prefer Duplicator copies as described in this article https://toolset.com/faq/provide-supporters-copy-site/
Please use filter to reduce the size of the copy as described in this video around 1:00 hidden link
If Duplicator fails to create a copy, we'll need a database copy/export, plugins, and theme folders, all in a zip file.
Your next reply will be private to let you share the download link safely.

We will also need to know, what form? And where it is being used?

#1785801

I tested the following form hidden link
And I was able to receive a notification email into my address. Check this screenshot hidden link

If it is not working on your production site, it may explain a difference in the mail toolchain from wp_mail in WordPress into your local SMTP client or "WP Mail SMTP". Note that "WP Mail SMTP" is disabled on the beta site.

#1785805

Did you actually submit the form or just tested using the test feature?

Because test works here too, but nothing happens when I submit.

#1785921

I did not submit the form, I only used the test feature on the notification section.

Please, let me know, where the form is being used and I'll do a test?

I might need to install a plugin to catch emails if I can't add my own email to the form and get the notification on it.

#1786109

Jamal,

In my opening post I have already noted that: "The test email feature works just fine."
In my follow-up private msg I have provided the url to the page where the form is located.

Feel free to install any extension you like on this beta setup.

#1786349

My apologies for missing those details and asking them again.

I took a Duplicator copy and built it on my local environment, then I installed "WP Mail Logging" plugin on it to catch emails. I was able to catch the notification email.
Then I did the same on your beta server, and I was able to catch the email here too. Check it here hidden link

This means, that the wp_mail() call is performed from the Toolset Form successfully. And this can prove that it does not happen correctly on your server, but that does not explain why the test email is successfully sent.

I'll migrate your website into our online platform and check there how the emails will be handled, I'll get back to you as soon as possible.

#1786353

Hi Jamal,
I checked the url you provided, I see there is actually an error that is visible in the raw log:

"Could not instantiate mail function."

Did you note this one?
Hope that helps...

D.

#1787709

Hello Dian,

Sorry for not bringing that error. It actually means that the "mail" function, provided by PHP is not available on your server. Check this article hidden link

On the other hand, I tested the PHP mail function and WordPress wp_mail function with a custom code that you can find in Toolset->Settings->Custom code, and the mails were sent, just like the test mail feature from Toolset Forms' notifications.
But, both emails were sent with different configurations:
- Form notification test email was sent from demorequest@biomax.com.
- mail() and wp_mail() test emails were sent from "felix.knoblach@biomax-mobil.de". I assume that this is the default email account on your server.

I am not sure why are these emails sent with different configurations. I'll suggest using an SMTP plugin and configuring it with your email accounts and check again. A plugin such as "WP Mail SMTP" or "Easy WP SMTP".

Please try it and let me know what you will get. If it does not help, I'll check with our 2nd Tier for his assistance too.

#1788463

Hi Jamal,

As noted in my thread opening post I have already "Tried custom SMTP mailer extensions without any success." ...

I talked to Felix who is the sysadmin and he let me know that the server is configured in a way that it can only send emails from existing mailboxes (demorequest@ mailbox was created for this purpose) , we also have the nicara@ .. mailbox which can also serve the same.

Unfortunately I still can't seem to figure out what is wrong. Obviously it is not server configuration because it works fine with other form plugins, the test feature etc...

And what is even stranger is that I had this working originally, then at one moment it just stopped. I guess the original thread author had a similar issue?

Maybe the PHP 7.4 update has a finger in this?!

I am still baffled 🙁

#1789387

I really understand the frustration you may feel about this issue. I am sure we'll find out what's the issue.

I would like to approach our 2nd Tier for assistance here too, but I'll need to first check what the debug.log file will have when the issue is triggered. So I installed the WP File Manager plugin to activate debugging and I submitted the form but the debug.log file was not created in /wp-content/ and the configured file in wp-config.php /error_log.txt was also not created.

Would it be possible to switch the PHP version to 7.2 or 7.0 just to check if the issue will persist on those versions too?

#1795051

Hi Jamal,

The beta website has been switched back to PHP v7.2

#1795369

I run a couple of tests and they all fail. And they all present the error "Could not instantiate mail function".

Every result on the internet explains that this error is related to the server configuration. Some results emphasize the "From: " header, which should be accepted by the server configuration. Other results talk about the "Bounce address" which needs to be accepted by the server configuration.
Check these pages:
- https://wordpress.org/support/topic/phpmail-not-working/
- hidden link
- hidden link

I am out of ideas, I'll ask for a suggestion from my teammates and our 2nd Tier and get back to you.

#1795383

Hi Jamal, thanks for the update. I know that perhaps it has something to do with the way the server interprets the data we send to it. I know it should have basic security settings that would disallow whatever is considered unsafe. What baffles me is that every other email/form plugin works but, and that even Toolset's own test feature works. But once we go live with the forms they fail. All this makes me think that perhaps we are missing something that has to do with the way CRED works in live mode.

#1807107

Our 2nd Tier has escalated this issue to the developers. They suspect that the issue appears on sending the notification because it uses the shutdown hook from WordPress, and also because of some server configuration.

As we do not have a reproducible clone, our developers would like to work on your server and expect that you will keep it for their debugging. I hope that you can afford that.

I remain at your disposal.

The topic ‘[Closed] CRED Form returning AJAX Request Failed!’ is closed to new replies.