If you recently stopped receiving emails from your Magento 1.x shop and you are using an Office 365 SMTP account configured in Aschroder SMTP Pro extension, then you might find this in your logs:
==> var/log/system.log <==
Warning: stream_socket_enable_crypto(): SSL: Success in /home/cbeauty/public_html/lib/Zend/Mail/Protocol/Smtp.php on line 206
==> var/log/exception.log <==ERR (3): Zend_Mail_Protocol_Exception: Unable to connect via TLS in [..] /lib/Zend/Mail/Protocol/Smtp.php:211
Weird thing is that in system.log it reports SSL: Success
, probably due to the way handshake is done with Office365, so that deterred me from pursuing the TLS version problem that I was suspecting in the initial investigation on the problem.
Quick solution
The quickest way to get it working again, is to force the Zend Mail library to use a specific TLS version instead of any TLS version.
Copy lib/Zend/Mail/Protocol/Smtp.php
to app/code/local/Zend/Mail/Protocol/Smtp.php
and in the local copied file change line 206 from:
if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
to
if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT)) {
Proper solution
Would probably be disabling obsolete TLS versions at server level, but this might not be that quickly accessible for some hosts.