Only Test emails is being sent
-
Hello,
We recently faced an issue with Offload SES, it doesn’t send emails at all (Not even queued). But when trying to send a test email it ends it normally and we receive it in our inbox.
I have checked the setup (IAM user / CNAME records to verify domain and email) but no luck, we can’t make this work at all
I have a staging site, and the plugin is working fine.
- This topic was modified 1 year, 7 months ago by yuehlia.
-
I am getting this error:
WP Offload SES #101: Mail function already overridden.
I found few tickets that reported the same issue but they were abandoned.
What I noticed is that in one of your changelogs for v1.1, you guys mentioned this:
“Every plugin activation results in “Mail function already overridden” logged to error log”
I am not sure what does that means.
- This reply was modified 1 year, 7 months ago by yuehlia.
Hey @yuehlia,
That error you’re seeing means another plugin is also trying to catch new emails to be sent and handle them, and due to the order of loading plugins has already created the
wp_mail
function before WP Offload SES can.Please check your other plugins to see if any might be trying to send emails and see if you can either deactivate that plugin if not needed, or turn off the email sending feature.
-IJ
We have an SMTP Plugin currently working on our setup, since SES wasn’t working with us.
I have indeed deactivated that smtp plugin and tried again, but no luck. It still shows this error. This is the only SMTP plugin we have.
Is there any way we can detect or find what plugin is using the
wp_mail
function?For reference, We were using WP Mail SMTP Plugin by WP Forms.
Hi @yuehlia !
You can try running the commands below on your site’s command line, on the main folder.
grep -R “function wp_mail”
grep -R “wp-includes/pluggable.php”It should display the files that have their own wp_mail function, or those that include WordPress’ pluggable.php files.
From there, you can try disabling one by one the plugins where those files reside and see if you can narrow down the source of the conflict.
Thank you for responding back,
I have three websites, one of them is a staging site that has the SES mailing functioning and working fine. The other two websites are production sites but SES is not functioning on them and giving same error I previously mentioned.
I ran the commands you provided, and this is what I found:
Staging site:
plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php plugins/wp-ses/trunk/wp-ses.php plugins/wp-ses/wp-ses.php plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/classes/wpml-wp/class-wpml-wp-api.php
Production Site #1:
plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php plugins/wp-ses/trunk/wp-ses.php plugins/wp-ses/wp-ses.php plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/classes/wpml-wp/class-wpml-wp-api.php
Production Site #2:
plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php plugins/wp-ses/wp-ses.php plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/classes/wpml-wp/class-wpml-wp-api.php
Knowing that the staging site is working fine with SES even with multilingual and wpml enabled. I am not sure if deactivating any plugin will do the trick.
Also, I noticed that (Production Site #2) is missing one folder from SES Plugin
/trunk/
. Not sure why and how that would affect the SES pluginHello @yuehlia,
Thank you for the update.
Are you getting other errors related to the plugin, aside from the “Mail function already overridden” message? If WP debug isn’t enabled yet, it might help to enable it.
This will cause all runtime errors, warnings, and notices to be written to /wp-content/debug.log, which will hopefully yield some better information about what’s going on.
As for the
trunk
folder, we checked our installation of the latest lite plugin, and we can’t seem to find that folder. Perhaps the staging site and production site #1 are using older versions of the plugin?Hello,
Thank you for the reply.
I have already enabled debugging on my sites, and this is the only error I am getting in
debug.log
.Hi @yuehlia ,
Hmmm, not sure if you pasted the error that you see on your debug.log file. Could you paste it again? Or you can use a third-party site to send us a screenshot of the error.
Also, did you run the commands separately? Could you send us the results for each command?
Sorry for the late reply, we had holidays.
So I ran each command separately. And here are screenshots of the results of the command:
grep -R "function wp_mail"
https://ibb.co/D7Hd05ygrep -R "wp-includes/pluggable.php"
https://ibb.co/vxxzT5gThe debug.log file has only one spammed error which what I sent to you earlier, and here is a screenshot of the Debug.log:
I hope this is helpful.
Hello @yuehlia,
Thank you for sending those in.
Could you try temporarily deactivating the following plugins to see if the issue disappears?
- wordfence
- add-fields-to-checkout-page-woocommerce
- sitepress-multilingual-cms
- duplicator-pro
Please do so after creating a back-up, and during off-peak hours, if possible.
The plugins above either have their own wp_mail function that could interfere with WP Offload SES’, or they’re also including the pluggable.php file. Since the pluggable.php is a core WordPress file that includes functions that should be overridden by other plugins, including that file loads those functions and prevents other plugins from overriding those functions.
I have disabled each one of these plugins and checked each time I disable one of them if the issue is fixed or not, but it seems that the issue persists while any/all of them are disabled.
I am no longer sure what is the problem here and if the
wp_mail()
function is really getting overridden by any plugin.Hi @yuehlia ,
Thanks for the additional information. That is really weird. At this point, the only test I can think of is disabling all other plugins, as well as switching to a default WordPress theme like Twenty Twenty, to see if the issue persists.
We recommend doing this on a staging site, or during off-peak hours if you don’t have a staging site.
If there is no other active plugin that is overriding the wp_mail function, the only other way that error could come up is if WordPress is loading it’s own wp_mail() function before WP Offload SES has a chance to redefine it.
As a test, could you please try installing WP Offload SES as a must-use plugin? To do that, you would need to create the “wp-content/mu-plugins” directory if it doesn’t exist,?and then move the wp-offload-ses folder into the wp-content/mu-plugins directory. Finally, you’d need to drag the main “wp-offload-ses.php” file out of the plugin folder so that it’s directly inside the mu-plugins directory.
Doing that should ensure that WP Offload SES loads before anything else and is able to overwrite the wp_mail() function.
I am also having this issue. The odd thing is that when I run the grep for
grep -R "function wp_mail" grep -R "wp-includes/pluggable.php"
The only plugins that come up are Jetpack. So I disabled that, but the issue still happens.
I went ahead and disabled all of the plugins that could be related to any mail function, but the issue still occurs. Using Woocommerce.
The other weird thing is that my plugins are all the same. The only thing I did differently was change PHP from 7.4 to 8.2 and then update WP Offload SES to 1.6.5. I disabled all of my plugins that could be related to this and it still shows the message.
If I use
mu-plugins
then it works.- This reply was modified 1 year, 3 months ago by asheroto.
Hi @asheroto,
Can you please try running this command instead?
grep -R "/pluggable.php"
If it gives out another set of plugins, kindly try temporarily deactivating them if it helps. Please do so after creating a back-up, and during off-peak hours, if possible.
Putting WP Offload SES inside the mu-plugins directory ensures that it will load before anything else and overwrites the wp_mail() function.
- The topic ‘Only Test emails is being sent’ is closed to new replies.