summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorRadu Potop <wooptoo@gmail.com>2011-09-29 09:19:55 +0200
committerRadu Potop <wooptoo@gmail.com>2011-09-29 09:19:55 +0200
commit4c589aed7b0215e3d4105b11776bc45f299d291d (patch)
tree504cdc4901b46246109222f90574b7d5cbc9eb13 /system
parentad67aae58583bf08f2ca306d100052d6d5ed629e (diff)
style edit, print error if crypto fails
Diffstat (limited to 'system')
-rw-r--r--system/libraries/Email.php12
1 files changed, 11 insertions, 1 deletions
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');