I recently upgraded my site to 4.7.1. Outbound SMTP does not work. Even though I use the correct credentials, I get errors and email does not send. I restored my site back to 4.6, and all is good.

Tried testing on your sandbox, but 4.7 is not available yet.

  • What error do you get? could you put the detail in your question? And can you clarify if the error happens both for transactional emails and civimail? As the availability of the demo/sandbox for 4.7: sending emails is disabled there, so it won't help sorting out your problem
    – Xavier
    Feb 8, 2016 at 9:49
  • I also have problems since 4.7.1 with SMTP. It seems that my provider wants authentication without TLS, but there seems to be no way to configure that. The summary of the "test" is as follows: With SSL and using port 465 I get the message: "Failed to connect to ssl://smtp.mail-ch.ch:465 [SMTP: Failed to connect socket: Connection timed out (code: -1, response: )]". Without SSL and using port 587, I get: "authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 Ready to start TLS)]". Wordpress is the newest, civicrm v4.7.1, and it's running under PHP v5.6. Is V4.7.2 a fix? Feb 29, 2016 at 19:40
  • An answer I posted here has been linked to this question. However I doubt that these two questions are duplicates as this one is due to CiviCRM upgrade and the other is due to server package update. Unless php is also updated in this scenario, it is better to keep this question here. Otherwise we should mark this duplicated after the action in this answer is approved by core team.
    – Guanhuan
    Apr 7, 2016 at 13:34
  • My hosting provider, Civihosting, moved us from PHP 5.5 to PHP 5.6 on 4/11 and this morning one of our folks ran into what seems like the same problem with civimcil. When sending a test of an unscheduled mailing, he receives the error: Error in call to Mailing_send_test: STARTLLS failed So this looks like the issue is the PHP version. When we have more info, we will post it. Apr 12, 2016 at 12:30
  • Confirmed with Civi 4.7.10 on Joomla 3.6.2 on PHP 5.6. Rolled back to PHP 5.5.38 and SMTP works again. This is a qualified bug.
    – BruceW
    Aug 9, 2016 at 1:53

3 Answers 3


From what I understand, this can be because the server you contact has a self-signed certificate (see this question for a workaround), or because the PEAR SMTP package version used by CiviCRM does not support TLS. Civi uses 1.6.1, but support was added in 1.7.1.

In our case (php7, CiviCRM 4.7), we are able to work around this by forcing SSL connection rather than TLS. In the Outbound mail settings 1) put ssl:// in front of the mail server name 2) change the port to something appropriate. Usually to 465**

  • +1 self signed. I created a certificate for my server from LetsEncrypt changed the server name in CiviCRM from localhost to my.real-server-name.com and it was happy. CiviCRM 5.3.1 PHP 7.0 Oct 29, 2018 at 14:03

Same error with CiviCRM 4.7.4, Drupal :

authentication failure [SMTP: STARTTLS failed (code: 220, response: 2.0.0 continue)].

Using mail() allows us to send mails, but with the local SMTP server.

Downgrading to PHP5.5 resolves this problem. With PHP5.6 the problem is in packages/Net/SMTP.php when calling $this->_socket->enableCrypto()

This is due to php 5.6 : https://civicrm.stackexchange.com/a/10966

  • 3
    Using php 5.5 resolve this problem. With Php5.6 the problem is in packages/Net/SMTP.php when calling $this->_socket->enableCrypto( ...
    – olivier
    Apr 5, 2016 at 22:56
  • 1
    can you add your comment as part of the answer to make it more like an answer ;-)
    – petednz - fuzion
    Apr 6, 2016 at 5:00
  • I'd be interested if you can expand your answer Olivier, or create an issue with details over on issues.civicrm.org Apr 6, 2016 at 8:08
  • PHP5.6 changed the defaults for cert verification (php.net/manual/en/migration56.openssl.php) but I'm not sure that sounds like what you describe; it would explain the breakage being linked to v5.6 though ... See also CRM-14814 and CRM-8744. Apr 6, 2016 at 8:12
  • 1
    Not tested yet : civicrm.stackexchange.com/a/10966
    – olivier
    Apr 6, 2016 at 20:13

Seems there is some work in progress to attach this on CRM-18408 SMTP connection via SSL and TLS in PHP 5.6

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.