summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorDiogo Osório <diogo.g.osorio@gmail.com>2012-03-02 17:54:52 +0100
committerDiogo Osório <diogo.g.osorio@gmail.com>2012-03-02 17:54:52 +0100
commit7fcc7bdf7eb9c65920b1e14f242e31e3d71d1fd0 (patch)
treec4d6fa2370fb882b5cc889a64985f1b742d4d40c /system/libraries
parent00df2e3183dc1cbef82dafe6cc432d73fe659ae9 (diff)
#1080 - Check if the SMTP connection and authentication were successfull.
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Email.php7
1 files changed, 5 insertions, 2 deletions
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']));