
Contact form 7 is one of the best form plug-in with 5+ million downloads and 4.9 ratting it is used for making contact forms on WordPress websites. Its easy to use and easy to customize. The users can easily add or remove contact fields according to their choices. In recent updates CF7 is getting some issues regarding message sending. Failed to send your message. Please try later or contact the administrator by another method. and There was an error trying to send your message. Please try again later These are the two most common errors in CF7. There are several things which are becoming the causes of such problems. In this tutorial I’ll discuss all the reasons and will explain how to fix them.
Cache Issue
The very common and basic reason of this error is cache. I noticed that Contact form 7 generates a unique token when a user submits the form. But due to Cache issue it was not able to generate the unique tokens. That’s why it was throwing the error.
We can simple fix this problem by
- Install WP-Super-Cache
- Go to its Advance tab
- In this tab search for Add here string
- Enter the page name where you have embedded the contact form, for example, you have embedded on the contact us in this case enter /contact-us/ in the tab
- And click on Save String
Anti Spam Plugins
Sometimes some anti-spam plugins stop CF7 to send emails and messages. the very common Plugin which is used for anti-spam is Askmit try to deactivate this plugin.
Changing the mail function
This is also a handy method to get rid of this issue. Go to your C panel
/wp-contents/plugins/contact-form-7/includes/mail.php
after getting to this file find the line number 85 and change the return wp-mail ()to return mail()
If you are still failed to fix the issue feel free to drop your comment under this post I’ll assist you in possible ways.
Thank you ateeeb. In my case i changed the mail function and it start working.
Glad to see that its working for you.
I couldn’t find the email function.
Go to C panel and then /wp-contents/plugins/contact-form-7/includes/mail.php press Ctrl+F and return wp-mail ()
I tried all of these and still get the same message.
Bear can you please mention your url where you are getting this error.
What do you mean with “return wp-mail ()”? Could you elaborate?
My Form URL is this
http://www.cleanwise.in/contact/
In the mail.php I could find wp_mail () in line 134 and not 85. And there is no code wp-mail ().
I changed wp_mail () to mail (). Still it didn’t work.
Please help.
send me your website details at ateebahmad76@gmail.com I fix it.
OMG, please help! I am having the same problem. I have tried everything you suggested. Please help! The form is at the bottom of the home page and also on the contact page. In your instructions about “Add here” above, there are two places in the WP Super Cache that have “Add here” – you don’t specify which place to add the code. I added it in the first section.
In Advanced Tab, Two “Add Here” Sections:
There is this section:
Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it’s enough to specify the year, i.e. ’/2004/’. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.
And there is this section:
Add here those filenames that can be cached, even if they match one of the rejected substring specified above.
wp-comments-popup.php
wp-links-opml.php
wp-locations.php
Again, please help!!
Can you send inbox your details at ateebahmad76@gmail.com
Hello,
I have tried to solve this also. I changed the word wp_mail to mail on line 138
This did not helped
I have installed WP supercash and added the page http://planvastgoed.nl/contact/ on:
Add here strings (not a filename) that forces a page not to be cached. For example, if your URLs include year and you dont want to cache last year posts, it’s enough to specify the year, i.e. ’/2004/’. WP-Cache will search if that string is part of the URI and if so, it will not cache that page.
and I also added this url on:
Add here those filenames that can be cached, even if they match one of the rejected substring specified above
It all did not work.
Can you please help my any firther?
can you make sure Askmit plugin is activated ?
Hello,
i’ve already change the word wp_mail to mail on line 134 but it doesnt worked.
can you plase help me ?
Did you try other methods ?
yes, i’d used smtp mail and it doesn’t work
Do NOT change wp_mail() to mail()! This will override the WordPress mail function and all associated hooks & filters – so mailgun or whatever other mail plugin you use will no longer be used to send mail. This is contraindicated on so many levels I’m not even going to get into it.
Hi Ateeb Azhar,
This is Sridhar and having the same problem and followed all your recommendation and still having the same problem. Can you please help me to resolve. Please let me know to which email I can send the file where you can help me to fix it please.