If the mail() function is called only once in the PHP code, then the PHP code is run 3 times. It seems to indicate the page is loaded multiple times.
A test can be made by using mt_rand(0,99999) to insert a number into the email being sent. If the number is different in each of the emails, then the mail() function was called 3 times. If the same number in each of the 3 emails, it would seem mail() is sending the email to an address that delivers 3 times (unlikely, but can be tested), perhaps a loop in forwarding directives.
As to how the page could load multiple times, it may be because of another plugin, or two of them. I’ve encountered SEO plugins that load the page in the background, for example, perhaps to read the generated content of the page.
Try deactivating each plugin, in turn, and testing the page with the mail() function with each individual deactivation. The test may reveal which plugins are loading the page an extra time.
Will
Thread Starter
xdepub
(@xdepub)
Whao !
I think you got exactly the problem. I made the tests you mentionned already, and got that clue that it might be the page that was charging 3 times.
I deactivate some plugins and YOAST SEO seems to be the responsible for this. I would have never guessed that.
Thanks a lot.
This plugin is great.
-
This reply was modified 9 years, 5 months ago by
xdepub.