3

In this page, I'm using the Contact Form 7 plug in (at the very bottom).

When I fill the form and press send the form stay loading forever.

Any suggestions?

code:

<p>您的姓名 〈需填寫〉<br />
    [text* your-name] </p>

<p>您的電子郵件信箱 〈需填寫〉<br />
    [email* your-email] </p>

<p>主旨<br />
    [text your-subject] </p>

<p>您的信件內容<br />
    [textarea your-message] </p>

<p>[submit "傳送"]</p>

(there's isn't really too much code since is a Wordpress plugin).

I'm using Wordpress 3.0.1 and Contact Form 7 (3.3.1)

alexchenco
  • 53,565
  • 76
  • 241
  • 413

7 Answers7

12

Step:1

Go to ftp:

wp-content/plugins/contact-form-7/contact-form-7.php

In contact-form-7.php

Step:2

Find:

if ( ! defined( 'WPCF7_LOAD_JS' ) )
    define( 'WPCF7_LOAD_JS', true);
Replace:
if ( ! defined( 'WPCF7_LOAD_JS' ) )
    define( 'WPCF7_LOAD_JS', false );

upload your file and Try it done.

Balaji Kandasamy
  • 4,446
  • 10
  • 40
  • 58
VijaiJerald
  • 161
  • 1
  • 5
  • Yes, this One worked for me Thanks a lot. I was working for more than a day to fix this issue. I would like to clarify a thing here though. what would happen when the plugin gets updated. I create websites for various clients and there are multiple websites. editing each website like this each time will be a big head ache. – iSrini Sep 06 '17 at 16:00
  • @VijaiJerald, But, it reload the site. It's bit problem. – Kaizur Apr 30 '19 at 10:46
4

Try another contact form plugin to see if you can send any email at all. Check your webhost error logs for php errors.

Use the developer tools in your browser to check for Javascript errors. Contact Form 7 uses javascript for some of the form processing, and you may have a Javascript conflict.

The issue might be a server problem. Ask your webhost if there are issues using php mail. Try sending an email manually using php mail; see How to send an email using PHP?

Also, try WordPress › WP Mail SMTP « WordPress Plugins which allows you to test send email via SMTP and will show a log of server actions and which will let you possibly find the issues.

markratledge
  • 17,322
  • 12
  • 60
  • 106
  • Yes, I have Installed the recommended Plugin. But the arrow at the bottom Still keeps rotating and the messages never really go out. The solution Suggested by VijaiJerald fixed the issue but I know that it is not the best solution as updating the plugin will again make it not work. – iSrini Sep 06 '17 at 16:02
2

Since I don't want to edit any plugin files I went with the filter options:

// WPC7 forms were not submitting, this fixes that
add_filter( 'wpcf7_verify_nonce', '__return_true' );
add_filter( 'wpcf7_load_js', '__return_false' );
Julix
  • 598
  • 1
  • 9
  • 20
1

Editing contact-form-7.php as mentioned above helped but my emails would not arrive in my inbox, but they were in my sent box.

Similar to my configuration:

  • Google Cloud for hosting WordPress (WP)
  • Google’s G Suite for email (smtp.gmail.com)
  • Contact Form 7 - WP Plugin
  • Postman SMTP - WP Plugin
  • Main email - John-Doe@example.com
  • Alias email - info@example.com

I was able to get the emails to my inbox by using the main-email account in the From location in Postman SMTP instead of the gmail alias because the main was needed for authentication.

Worked: From: John-Doe@example.com To: info@example.com
Did not work: From: info@example.com To: info@example.com

The text below is from the chat session with Google’s Support.
The reason why you have to use a different domain is because the web forms get confused and try to deliver the email at your web host rather than your mail host, they see your domain in the recipient and say "hey this is the same domain where the site is hosted at, it should be the same, lets save some effort looking at the domain’s MX records and lets leave it right here". The From: field needs to be your primary email address since it requires authentication (aliases can’t authenticate), the TO: field has to be preferably an email not from your domain name, like the test alias example.com.test-google-a.com. If you are sending it from a website is different, the behavior when it gets dropped is just when you use Gmail web mail or a mail client. For web forms, send the emails to the aliases from the test example.com.consulting.test-google-a.com.

Code_Help
  • 303
  • 3
  • 13
  • 5
    Probably because you're submitting your answer in multiple parts. Are you not able to combine your posts here into a single answer? – C. Helling Jul 27 '17 at 16:13
  • It would not allow me to post the entire answer in one posting. I'm surprised that someone gave me a negative point for the reply because the answer will be helpful to someone. I spent several hours attempting to determine why emails. The code change above helped get email to Flamingo but not out of WordPress. – Code_Help Jul 28 '17 at 17:36
  • I'm not the one that downvoted, but I also don't have sufficient privileges to edit your answer for you. Sorry. – C. Helling Jul 28 '17 at 17:37
  • Thanks. Maybe I should have written it in steps? Do this. Then do this? – Code_Help Jul 28 '17 at 17:40
  • @Code_Help please remove your second answer, I have edited the content into your first post for you, so it is no longer needed. – Frits Jul 28 '17 at 17:40
  • 2
    We generally have problems with users posting miniscule low quality answers, so let me be the first to say thank you for posting such a complete answer. I would however leave you with a bit of advice, unless you have multiple sets of advice, try to shorten your answer down to the __important__ bits. It makes much easier/quicker to read. :) Good luck! – Frits Jul 28 '17 at 17:46
1

It might be conflict with other plugins, like another contact form? In my case I was using MMForms-Community and Contact Form 7 is the reason.. So in other words, I can not use both as they conflict with each other from WP version 3.0 and up.

0

I want to add to VijaiJerald's answer. That particular solution didn't work for me, but it did work when I changed as he proposed:

if ( ! defined( 'WPCF7_LOAD_JS' ) ) {
    define( 'WPCF7_LOAD_JS', true);
}

Replace with:

if ( ! defined( 'WPCF7_LOAD_JS' ) ) {
    define( 'WPCF7_LOAD_JS', false );
}

But also the following line:

if ( ! defined( 'WPCF7_VERIFY_NONCE' ) ) {
    define( 'WPCF7_VERIFY_NONCE', false);
}

Replace with:

if ( ! defined( 'WPCF7_VERIFY_NONCE' ) ) {
    define( 'WPCF7_VERIFY_NONCE', true );
}

I also want to note that literally no other solution worked for me (disabling all plugins, changing the WP_DEBUG value, resetting the browser, reinstalling Wordpress, updating and upgrading all plugins, disabling all custom CSS and JavaScripts, etc...) so this might help people that have this issue. I also want to note that while it wasn't working on my laptop (tried multiple browsers), I didn't had this issue on my phone at all.

0

Usually infinite loading is caused by a problem in your theme. You can overwrite the style/code of Contact Form 7 with javascript and a piece of css. You can solve this problem with the following piece of javascript:

document.addEventListener( 'wpcf7submit', function( event ) {
   jQuery('head').append('<style type="text/css">.aw-no-spinner:before{display:none!important}</style>');
   jQuery('body').find('.processing').addClass('aw-no-spinner');
}, false );
jQuery('.wpcf7-submit').on('click', function( event ) {
   jQuery('body').find('.processing').removeClass('aw-no-spinner');
});

In this example we use the built-in hook of contact form 7: wpcf7submit

When this event is fired then our piece of code is executed. This piece of code adds an extra class to the loading wrapper of contact form 7. And also we add a piece of css to the head so we don't have to put this in a separate CSS file.

We have also incorporated this solution into a WordPress plugin for users who prefer not to add code to their website or do not have a child theme.

This is the link to the plugin, but you can also use the piece of code described above. https://wordpress.org/plugins/awcf7-stop-spinning/

Rick
  • 1
  • 1