Support

Home Forums Event Espresso Premium Many messages not getting through

Many messages not getting through

Posted: August 13, 2019 at 6:54 pm

Viewing 1 reply thread


hoboken

August 13, 2019 at 6:54 pm

After updating WordPress, EE, and a slew of other plugins that hadn’t been updated in months, we’ve started having problems with EE messages (many, but not all) not reaching the wp_mail function. Our web host confirmed that no email problems are showing on the server and that the error is happening before the message even gets to the wp_mail function. The error message is “An error has occurred: The email did not send successfully. The WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.” We’re using the Easy WP SMTP plugin for mail configuration. System info below. Thanks in advance for your help.

WordPress Version: 5.2.2
PHP Version: 7.3.7
MySQL Version: 5.5.5
Event Espresso Version: 4.10.0.p
WordPress Address (URL): https://hobokenchildrenstheater.com
Site address (URL): https://hobokenchildrenstheater.com


Tony

  • Support Staff

August 14, 2019 at 5:34 am

Hi there,

The problem is likely with whichever mail server you are using, but it could also be a plugin hooking in and doing something to all wp_mail() calls, which leads onto this:

Our web host confirmed that no email problems are showing on the server and that the error is happening before the message even gets to the wp_mail function.

This simply can not be true if you’re getting the error above, to explain:

The error message is “An error has occurred: The email did not send successfully. The WordPress wp_mail function is used for sending mails but does not give any useful information when an email fails to send.”

There is only 1 place in EE that generates that error message and it’s the call to wp_mail() itself, here’s the code in question:

https://github.com/eventespresso/event-espresso-core/blob/master/core/libraries/messages/messenger/EE_Email_messenger.class.php#L431-L458

On this line we call wp_mail() and pass it the to, subect, body and headers values the message system has constructed for the mess. We save the return value to $success and check if that value is false if it is, we trow the above error mentioned.

So as you can see, wp_mail is being called and its actually wp_mail itself that is returning false. wp_mail() doesn’t return anything else to help explain what happened to the email or why it failed, which is… not so useful.

—-

Now, you mentioned you are using the easy wp SMTP plugin to set up your emails, which mail server are you connecting to? Your host may be checking their local server but if you using the above you could be sending the emails to a completely different mail server, hence why they can’t find anything.

There’s a few ways to troubleshoot this, what I would do is add this snippet to your site:

https://gist.github.com/Pebblo/bfd6aa3b88a2459668504f75a57bc324

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

That should then add any errors thrown from wp_mail into the error message section you used to get the above error. Then get the error to trigger again and view the error, if should have some additional details.

Note – I’ve called it a ‘hacky’ function in the gist because it was a proof of concept which doesn’t follow our standards do its job, there’s nothing suspect in that code, it’s just a ‘hacky’ way of doing what it does.

Viewing 1 reply thread

The support post ‘Many messages not getting through’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso