From 4c589aed7b0215e3d4105b11776bc45f299d291d Mon Sep 17 00:00:00 2001 From: Radu Potop Date: Thu, 29 Sep 2011 10:19:55 +0300 Subject: style edit, print error if crypto fails --- system/libraries/Email.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'system/libraries/Email.php') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index 648bb6b4d..ef20e1978 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1669,8 +1669,12 @@ class CI_Email { protected function _smtp_connect() { $ssl = NULL; + if ($this->smtp_crypto == 'ssl') + { $ssl = 'ssl://'; + } + $this->_smtp_connect = fsockopen($ssl.$this->smtp_host, $this->smtp_port, $errno, @@ -1689,7 +1693,13 @@ class CI_Email { { $this->_send_command('hello'); $this->_send_command('starttls'); - stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); + $crypto = stream_socket_enable_crypto($this->_smtp_connect, TRUE, STREAM_CRYPTO_METHOD_TLS_CLIENT); + } + + if ($crypto !== TRUE) + { + $this->_set_error_message('lang:email_smtp_error', $this->_get_smtp_data()); + return FALSE; } return $this->_send_command('hello'); -- cgit v1.2.3-24-g4f1b