Conversation
supportHi there, I’ve just updated to the latest version of 4.7.2 and it no longer works. I’ve tried sending some test emails and it just says “Sorry, there has been a problem and your message was not sent.” Any help to resolve this would be great. Thanks. The page I need help with: [ log in to see the link]
The message “Sorry, there has been a problem and your message was not sent” is generated when wp_mail returns ‘false’ There was one change relating to mail in that the header is set to say it is ‘text’ ( as some mail clients will assume html and then there are no line breaks ) Can I ask, are you using any mail plugins ( e.g. a smtp mail plugin ) Can I also ask, does your site send emails normally and they arrive, e.g. password reset It is always useful to post the Tools>Health Check>[Info] Copy & paste as it list all the technical environment / plugins etc.
The only email-related plugin we have is a newsletter one which is part of the theme. haven’t needed to reset anything but haven’t had any other email issues before related to the site. The health info is too detailed to post here in public.
OK, Thanks I will investigate. [By the way when I first tested on your site the newsletter plugin generated a javscript error that stopped submission ( this is not the problem you reported ) when I refreshed the page the error went. Just letting you know.] One thing you can do, to rule out plugin / theme conflict is to install https://wordpress.org/plugins/health-check/ which allows you to turn off all plugins and set the theme to default – without impacting users – then you can test with just my plugin. It would be really useful if you could do that – just to rule out conflicts.
Thanks so much for taking a look. That’s odd about the newsletter plugin, all seems fine on my end and just redirects to the Mailchimp page so all handled on their end. Thanks and will look further into it. I’ll download the health plugin now.
Just fyi on the javascript errors https://ibb.co/9qq5yfW
Seems to be CURL and Loopback errors, not sure if that’s related? “Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability. The loopback request to your site failed, this means features relying on them are not currently working as expected. Error encountered: (0) cURL error 28: Operation timed out after 10000 milliseconds with 0 out of -1 bytes received”
OK I have tested in different environments so can’t replicate. But you can get debug info If you add this to your functions.php it will log it to your error log add_action( 'wp_mail_failed', function ( $error ) { error_log( print_r( $error, true ) ); } ); with info like [24-Jun-2021 14:10:59 UTC] WP_Error Object ( [errors] => Array ( [wp_mail_failed] => Array ( [0] => Invalid address: (From): ) ) [error_data] => Array ( [wp_mail_failed] => Array (
Just added to functions.php
OK I THINK I might have found an issue, as all my test environments have a way of creating email header overrides. Because I run this plugin of mine https://wordpress.org/plugins/stop-wp-emails-going-to-spam/ Can you try it – please and see if your problem goes. Then I will be able to work on a fix that doesn’t depend on that plugin ( although it is quite a good one )
Ok sure, will install it now and try testing the form again.
So I installed that plugin and the email form now works.
Interesting, so that is a change to PHPmailer / WP Mail at some point I assume, as I’m certain I didn’t touch anything related to from address processing at all. Now I know the problem I can find it to fix it
I’m not sure how, it’s all a little beyond my understanding. Maybe something in the past when changing hosts. That’s good to hear. Any rough timeframe? I’ll have to keep that additional plugin until then.
OK the issue is fixed in the latest release, please try it without the additional plugin.
Thanks Alan for doing the update. It’s all working good now. Much appreciated.
Brilliant, I’ll mark this as resolved.
The message “Sorry, there has been a problem and your message was not sent” is generated when wp_mail returns ‘false’ There was one change relating to mail in that the header is set to say it is ‘text’ ( as some mail clients will assume html and then there are no line breaks ) Can I ask, are you using any mail plugins ( e.g. a smtp mail plugin ) Can I also ask, does your site send emails normally and they arrive, e.g. password reset It is always useful to post the Tools>Health Check>[Info] Copy & paste as it list all the technical environment / plugins etc.
The only email-related plugin we have is a newsletter one which is part of the theme. haven’t needed to reset anything but haven’t had any other email issues before related to the site. The health info is too detailed to post here in public.
OK, Thanks I will investigate. [By the way when I first tested on your site the newsletter plugin generated a javscript error that stopped submission ( this is not the problem you reported ) when I refreshed the page the error went. Just letting you know.] One thing you can do, to rule out plugin / theme conflict is to install https://wordpress.org/plugins/health-check/ which allows you to turn off all plugins and set the theme to default – without impacting users – then you can test with just my plugin. It would be really useful if you could do that – just to rule out conflicts.
Thanks so much for taking a look. That’s odd about the newsletter plugin, all seems fine on my end and just redirects to the Mailchimp page so all handled on their end. Thanks and will look further into it. I’ll download the health plugin now.
Just fyi on the javascript errors https://ibb.co/9qq5yfW
Seems to be CURL and Loopback errors, not sure if that’s related? “Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability. The loopback request to your site failed, this means features relying on them are not currently working as expected. Error encountered: (0) cURL error 28: Operation timed out after 10000 milliseconds with 0 out of -1 bytes received”
OK I have tested in different environments so can’t replicate. But you can get debug info If you add this to your functions.php it will log it to your error log add_action( 'wp_mail_failed', function ( $error ) { error_log( print_r( $error, true ) ); } ); with info like [24-Jun-2021 14:10:59 UTC] WP_Error Object ( [errors] => Array ( [wp_mail_failed] => Array ( [0] => Invalid address: (From): ) ) [error_data] => Array ( [wp_mail_failed] => Array (
Just added to functions.php
OK I THINK I might have found an issue, as all my test environments have a way of creating email header overrides. Because I run this plugin of mine https://wordpress.org/plugins/stop-wp-emails-going-to-spam/ Can you try it – please and see if your problem goes. Then I will be able to work on a fix that doesn’t depend on that plugin ( although it is quite a good one )
Ok sure, will install it now and try testing the form again.
So I installed that plugin and the email form now works.
Interesting, so that is a change to PHPmailer / WP Mail at some point I assume, as I’m certain I didn’t touch anything related to from address processing at all. Now I know the problem I can find it to fix it
I’m not sure how, it’s all a little beyond my understanding. Maybe something in the past when changing hosts. That’s good to hear. Any rough timeframe? I’ll have to keep that additional plugin until then.
OK the issue is fixed in the latest release, please try it without the additional plugin.
Thanks Alan for doing the update. It’s all working good now. Much appreciated.
Brilliant, I’ll mark this as resolved.