0

Using CiviCRM 4.7.14 on WordPress 4.7.3. The configuration uses the default CiviCRM mail() mailer with a WordPress Gmail SMTP plugin.

Everything worked fine until about a week ago, but no configurations were changed. The Gmail SMTP Plugin sends mail successfully, but Civi does not. Any help on where to look would be greatly appreciated.

The error is:

Oops. Your MAIL settings are incorrect. No test mail has been sent. An error occurred when CiviCRM attempted to send an email (via SMTP). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt. The mail library returned the following error message: mail() returned failure This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are: Your Sendmail path is incorrect. Your Sendmail argument is incorrect. The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.

2
  • Can you provide information regarding each and every suggestion that the errors suggests. EG what have you got set for your From address? I understand you are saying 'this worked' so the settings have at some point been okay, and not suggesting they are now not, but it may help others diagnose if you fill in those blanks
    – petednz - fuzion
    Commented Mar 21, 2017 at 8:11
  • The only part of the message I left off was this:Mail Not Sent Sending test email. FROM: [email protected] TO: [my personal email]. The email has been the default email since the installation of CiviCRM. I can't figure out why mail would send from the Gmail SMPT plugin but not civiCRM using the default selection. Truly nothing has changed (as far as I know)
    – JByrd
    Commented Mar 21, 2017 at 13:10

1 Answer 1

4

When using mail() as your mail delivery method, CiviCRM will hand off to PHP's mail() builtin, which in turn usually hands over to a local delivery agent (see also PHP's mail configuration settings).

Unless the WordPress Gmail SMTP plugin does more sleight of hand than I anticipate, it won't get a say in how emails sent via mail() are delivered. WordPress mail plugins typically only get to intercept email routed through WordPress's wp_mail() wrapper. So based on your description (and my assumptions about WP Gmail SMTP), I think what happened is that previously your webserver was able to deliver via mail(), but now it can't.

You can investigate how it did work in the past by comparing the delivery headers of a previous WordPress generated mail (eg new user rego or password reset) with the delivery headers of a previous CiviCRM generated email. I think you'll find that they arrived via different routes.

Why they've stopped arriving is not so obvious. I'd try, in this order -

  • Check your PHP error log, which may contain more debug info about why mail() failed.
  • Check your PHP settings (via phpinfo()) to ensure that the mail configuration settings are correct/appropriate.
  • Check if the emails are being routed to junkmail; perhaps your mail host or the webserver config changed and the emails are being delivered but treated as spam. (Since CiviCRM says mail() failed, I don't think this is your problem.)
  • Check if the emails are being handled at all by your webserver, by investigating your webserver's mail logs. (How to do this depends on your server / hosting environment, you may need to request access from your hosting provider or contact a technician.)
  • Verify that your webserver is capable of delivering emails. (Perhaps some configuration changed, or the MTA daemon died and needs restarting.)
  • Verify your SPF / email configuration. (It looks OK from here, but you might find that your server is routing email over IPv6 and your SPF config doesn't handle this; that could lead to you being flagged as junk.)
1
  • 1
    I'm aware this isn't a single clear answer, but it's too long for a comment, and I hope it'll help point you in the right direction at least. From the details you've given, I don't think there is a single answer that would be right, but I hope the info re WP Gmail SMTP will assist you finding either the answer, or a better question 😀 Good luck! Commented Mar 22, 2017 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.