From 7fcc7bdf7eb9c65920b1e14f242e31e3d71d1fd0 Mon Sep 17 00:00:00 2001 From: Diogo Osório Date: Fri, 2 Mar 2012 16:54:52 +0000 Subject: #1080 - Check if the SMTP connection and authentication were successfull. --- system/libraries/Email.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'system/libraries/Email.php') diff --git a/system/libraries/Email.php b/system/libraries/Email.php index c8a5b41af..39a7059dd 100644 --- a/system/libraries/Email.php +++ b/system/libraries/Email.php @@ -1359,6 +1359,7 @@ class CI_Email { if ( ! $this->$method()) { $this->_set_error_message('lang:email_send_failure_' . ($this->_get_protocol() === 'mail' ? 'phpmail' : $this->_get_protocol())); + return FALSE; } $this->_set_error_message('lang:email_sent', $this->_get_protocol()); @@ -1433,8 +1434,10 @@ class CI_Email { return FALSE; } - $this->_smtp_connect(); - $this->_smtp_authenticate(); + if ( !($this->_smtp_connect() && $this->_smtp_authenticate()) ) + { + return FALSE; + } $this->_send_command('from', $this->clean_email($this->_headers['From'])); -- cgit v1.2.3-24-g4f1b