diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index c8d23bef0..f2132adc3 100644 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -750,17 +750,9 @@ class EmailComponent extends Object{ $this->__smtpConnection->write($data . "\r\n"); } if ($checkCode !== false) { - $response = ''; + $response = $this->__smtpConnection->read(); - while ($str = $this->__smtpConnection->read()) { - $response .= $str; - - if ($str[3] == ' ') { - break; - } - } - - if (stristr($response, $checkCode) === false) { + if (!preg_match('/^' . $checkCode . '/', $response)) { $this->smtpError = $response; return false; }