After upgrading CiviCRM to 4.7.21 (on Joomla 3.7.3), no emails get sent from CiviCRM (transactional or from CiviMailing). In System Settings >> Outbound Email (SMTP/Sendmail) when I click on "Save and Send Test Email" the page keeps reloading for about a minute, and then results in 500 error ("This page isn't working").

This worked perfectly before the upgrade.

Also, I no longer see file packages/Net/SMTP.php (I re-ran the CiviCRM install just in case) which used to send email via SMTP ... is this now handled by another file in another directory? Thank you so much for any pointers.

  • yeah that's a regression, look for a release real soon that fixes this Jul 10, 2017 at 17:09
  • 4.7.21 with Drupal is hopefully unaffected by this? I haven't seen problems with mailing so far.
    – Andy Clark
    Jul 10, 2017 at 18:32

1 Answer 1


As Mark said this is a known regression and we are looking at an expedited release. However as i can feel even a release this coming US Wednesday may be a bit late.

What i would advise you to do is to if you cannot wait make a patch to the file vendor/pear/net_smtp/Net/SMTP.php along the lines of https://github.com/civicrm/civicrm-core/pull/10622/files. The relevant block of code will be around ~line 600 of that particular file.

Otherwise wait until 4.7.22 comes out which will be very soon. In regards to why this may not affect all users, it only affects users if they need to authenticate to the SMTP server over TLS

  • Thank you, Seamus Lee and jackrabbithanna. I actually just grabbed the SMTP.php file from 4.7.20 which I downloaded from SourceForge, placed it in the packages/Net/ directory and emails flow perfectly again. I'm shocked we're not seeing more folks flagging this (not sure how one can do anything without email receipts, etc., in CiviCRM ... perhaps folks are using Sendmail (ugh).
    – MtnPavlas
    Jul 10, 2017 at 23:29
  • Also, the patch you linked to ... which file am I supposed to patch with it? (Sorry if it's obvious.)
    – MtnPavlas
    Jul 10, 2017 at 23:40
  • you need to patch vendor/pear/net_smtp/Net/STMP.php and look around line 600 and you should see the file like $this->socket or $this->socketOptions and change that to $this->_socket and $this->_socketOptions and you should be right. The patch i linked to is modifying a patching process that happens as part of composer when the CiviCRM tarball is built.
    – Seamus Lee
    Jul 11, 2017 at 6:01
  • Beautiful - thanks a lot for the pointer. This solved the issue (I have now removed the SMTP.php file from the packages/Net/ directory after patching vendor/pear/net_smtp/SMTP.php)
    – MtnPavlas
    Jul 11, 2017 at 16:57
  • This issue is affecting WordPress as well. I made the suggested changes and it is working again.
    – Codedogs
    Jul 11, 2017 at 18:23

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.