Posted: May 24, 2019 at 4:32 am
I am getting an error message when people register: “The email did not send successfully. The wordpress wp_mail function…” This message has been discussed at length in the forums, the thing is emails seem to be sending just fine, I receieve emails from test registrations and everything shows up in the email log as having been sent. Any insight is appreciated. |
|
Hi there, If you look in Event Espresso -> Messages -> Message activity can you see any messages with a ‘status bar’ (the coloured bar to the left) that is a colour other than green? If so, what message and context is it? When you say email log, is that the above or another log? |
|
We use an email log plug in to keep track of emails. Event Espresso’s email log shows a red bar next to the message that is meant to go to us when someone registers. this error is listed: Message was not executed successfully. However the email log plug in shows the email as having gone out and I can confirm it is delivered |
|
Usually what those do is capture the content right before wp_mail passes the email content over to send, so they can show emails that have actually returned an error just after that point.
There’s a few different messages that go to you (the admin), I’m assuming this is the ‘Registration Approved’ message type and that as it’s going to you, the Event Admin context? |
|
There’s a few different messages that go to you (the admin), I’m assuming this is the ‘Registration Approved’ message type and that as it’s going to you, the Event Admin context? Correct Yes |
|
Ok, so go to Event Espresso -> Messages -> Default message templates (assuming this is the template in use) -> Registration Approved -> Edit Event Admin. What is set in the To and From fields? In the from address it looks like you have a Change that to just Test another registration, does it no longer show the error? |
|
OK I made the change to [CO_EMAIL] but still got the same error message. As before, despite the message it did send the email |
|
Hmm, rather than me asking you to check multiple locations and post the shortcodes and what you see, can I take a quick look at the messages settings? If so you can send temp login details using this form: https://eventespresso.com/send-login-details/ If not that’s fine and the next quickest option is to send screenshots of all of the message contexts for the registration approved message type: https://eventespresso.com/wiki/messages-system-working-with-message-contexts/ For screenshots you’ll need to host the image and post the link here: https://eventespresso.com/wiki/troubleshooting-checklist/#screenshots (Note You can set the reply to private if preferred) |
|
Thank you for the login details. I had a look over your EE message activity log and the majority of failed emails are the Payment Received emails rather than the Registration Approved but it also seems a little sporadic as sometimes the same message types show they are sending fine, others not. Now I know you’re actually receiving the emails, but for some reason, wp_mail is returning false and that’s why EE is showing them as failed. I checked the mail log plugin you have installed and it basically captures the mail content right as it’s passed to wp_mail so it always shows the mail has sent. FOr example, this is a server I control and there is NO phpmailer service on this server (meaning it can not sent emails at all) yet that email log plugin shows them as sent, see – https://monosnap.com/file/4DTzl5mZSUym43Izy2OK2KfM6PsMaQ If I open them up in EE (with a little custom function to also show the errors returned when trying to send the email), I get this – https://monosnap.com/file/zzhLU09EVK9XIcjUw1EQqZ2YxYSvv3 So in short, you can not rely on that email log plugin to tell if an email actually sent or not, it isn’t capturing failures correctly. I can give you the code I’m using on my site to capture the error thrown when the email is sent and inject it into the error message EE shows (it isn’t 100% reliable in that it may not actually show the error, which is why EE doesn’t include it currently) but that may help shed some light on why the emails are failing. My guess is some emails are triggering spam filters and being rejected but its just a hunch without the error itself. So would you like to try that code and see if the error shows? The other option is to switch to a transaction email service which generally fixes deliverability issues like this, we have some details on those here: https://eventespresso.com/wiki/postmark-app-mandrill-transactional-email-handling-services/ |
|
The support post ‘Email error message’ 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.