Home›Forums›General Support – NOT for Volunteer and PTA plugins!›Error Sending Email
Tagged: email, error sending email, sending email
- This topic has 7 replies, 4 voices, and was last updated 2 years, 6 months ago by Lana Fraidenberguer.
June 3, 2016 at 12:09 PM #10524Matt DeuelParticipant
Love your plugin! Used it for an event a few months back and am returning to set-up a new event. Everything seems to be in order, except that when someone registers it give an “Error Sending Email” message right below the “You have been signed up message.” I’ve done a few test sign ups with different names, emails, and browsers all getting the same result. After checking inboxes, no confirmation emails have been sent to volunteers. No emails are being sent to their Event Chair either. Any thoughts/direction? Thank you!
June 3, 2016 at 1:44 PM #10526
I’m certain I just answered this same exact question from someone else a month or two ago, but can’t find where that was. Lots of answers to similar questions about email issues on the WordPress.org support forum for the sign-up sheets plugin, though.
Since it’s nowhere on this forum yet, I’ll put my comments here for future referral.
That particular “Error Sending Email” message is created by my plugin ONLY when it receives an error response from the WordPress email function.
In other words, my plugin creates all the necessary info for the email (from, to, reply, cc/bcc, subject, and text), formatting according to the WordPress codex guidelines, and then it uses the WordPress wp_mail function to actually send the email:
If that function returns a value of false, it means that there was a problem sending the email. So, if you are seeing that error message, it means either something is wrong with the WordPress wp_mail function (not likely, unless some files are corrupted on your server), or something is not configured properly on your server for the PHP sendmail function (which is what the WordPress wp_mail function uses by default).
I have found on some servers, they don’t like the way CC or BCC addresses are formatted by my plugins (especially if there is more than one email in the BCC field), even though I’m formatting them exactly the way that the WordPress codex specifies. Not much I can do about that. The only way to do it differently would be to loop through every CC or BCC email and send a separate email out for each one, instead of trying to include all the addresses in one CC or BCC field. Not an efficient way to do things, but I had to do that for a custom development project for someone else since their sever simply wouldn’t accept multiple emails in the BCC field, no matter how I formatted them.
Also, note that if you are using the standard WordPress method of sending emails, you are sending through the PHP sendmail script, almost always as user “nobody” (which is how PHP scripts are normally run on most servers). However, perhaps with a security update, your server was set to NOT allow emails to be sent by user “nobody”, effectively making the default PHP sendmail method useless unless you are able to configure it to send as the account owner instead of nobody. There are also some email clients that are more likely to mark messages as spam if they come from these “nobody” type of users. So, you also have a lower chance of delivery.
The BEST way to avoid ALL of the above issues is to install a plugin that takes over the wp_mail function and sends emails through a real SMTP account instead. I do this for ALL of my own web sites, as its MUCH more reliable and I also get a copy in my “sent” folder for my email account (I use Google business email for ALL my sites).
My new favorite plugin for this is Post SMTP:
You should definitely look into setting that up on your WordPress site and connecting it to a SMTP email account (set up a dedicated email address on your server for your WordPress site if you don’t want to use a personal email address).
Other than that, there is not much more I can do as my plugin is simply reporting that WordPress generated an error when it tried to send the email, meaning the email did NOT get sent.
- This reply was modified 1 year, 10 months ago by Stephen Sherrard.
June 4, 2016 at 9:01 PM #10530Matt DeuelParticipant
Thank you for your very thoughtful and detailed response. I truly appreciate the time you’ve taken to explain this. At first pass, I’m having some trouble with Postman-SMTP… but I trust that is something I’m doing wrong. I’ll go thru their documentation and figure it out. Thank you for the help and recommendation.
November 28, 2016 at 7:38 AM #13358
Also, note that in case it is the formatting of the BCC fields giving your server problems sending emails, in version 1.13.0 I added options to send emails 1 at a time instead of using BCC:
New option added in Email Settings to send all CC/BCC emails as separate TO emails, potentially bypassing issues on some servers that do not like the default formatting of multiple CC/BCC emails in the header when using default server Sendmail (wp_mail) function, as opposed to bypassing Sendmail by using an SMTP plugin to send all WordPress emails via SMTP (much more reliable)
January 24, 2017 at 4:41 PM #14148Troy WolfParticipant
In hopes it is helpful for folks, I got tired of quirky issues around sending email that almost always were caused by issues with my own server. I either had an SMTP misconfiguration or needed to add SPF records to my DNS to prevent getting black-listed, yada, yada, yada. On top of that, when mail failed, it was like a black-hole with no logs to look at….because I didn’t know how to properly configure everything in the server nor where to look.
Now I use the Mailgun service (http://www.mailgun.com). No I don’t work for them. I am using their SMTP on several client sites including WordPress sites now. Mail sending with Mailgun is extremely fast and they have a sweet dashboard you can log into to see your mail logs. If mail fails, you’ll know why! This has been worth gold when clients tell me, “the website never sent me the confirmation”. I can go into my Mailgun account and see the SMTP traffic and their mail server’s receipt of the message.
The service is free for up to 10,000 messages per month…which I come nowhere near hitting.
To use an SMTP server (instead of your own local WP server), you need to install a plugin to do SMTP. I use this free one: http://www.callum-macdonald.com/code/wp-mail-smtp/
November 11, 2020 at 7:35 PM #31890Lana FraidenberguerParticipant
I am having difficulties with email sending function from Volunteer Signup Sheet plug-in. The plug-in documentation was consulted and the following recommendations applied:
Using WP SMTP SendGrip mail client,
Separate CC/BCC to individual TO emails setting is checked “yes”
Test emails from SendGrid goes with no issues.
The support forum research gives exactly the same recommendations.
The error message from Volunteer Sign up plug in is “EMAIL DELIVERY ERROR: the plugin WP Mail SMTP v2.5.1 logged this error during the last time it tried to send an email:
Header can not be one of the reserved keys. Refer to documentation link. – headers.Content-Transfer-Encoding; http://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/errors.html#message.headers”
Would you be able to provide any further guidance or recommendation on how to fix this issue?
November 11, 2020 at 8:07 PM #31892
That is not my plugin generating that error. I have nothing to do with SendGrid, and have never used it myself. You need to refer to the support team for whoever created the SendGrid plugin that you are using in your WordPress install.
My plugin creates all the parameters, including the headers, according to the wp_mail function specs, which you can read here:
My plugin calls the WordPress function wp_mail to do the actual sending of the emails. All of the various SMTP plugins for WordPress, including anything that uses SendGrid, is replacing the wp_mail function in WordPress. If they do not properly replace the functionality of wp_mail and allow use of the same parameters and functionality, then that is their problem and nothing to do with my plugin.
November 12, 2020 at 9:13 AM #31900Lana FraidenberguerParticipant
Thank you, Stephen, for your reply! I will consult with SendGrid plug in support.
- You must be logged in to reply to this topic.