mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Fixed minor bug in connect communications with SMTP server
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7059 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
ecc4347e25
commit
67f2255076
1 changed files with 10 additions and 7 deletions
|
@ -665,9 +665,11 @@ class EmailComponent extends Object{
|
|||
if (!$this->__smtpConnection->connect()) {
|
||||
$this->smtpError = $this->__smtpConnection->lastError();
|
||||
return false;
|
||||
} elseif (!$this->__smtpSend(null, '220')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$this->__smtpSend('HELO cake', '220')) {
|
||||
if (!$this->__smtpSend('HELO cake', '250')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -723,15 +725,16 @@ class EmailComponent extends Object{
|
|||
* @access private
|
||||
*/
|
||||
function __smtpSend($data, $checkCode = '250') {
|
||||
$this->__smtpConnection->write($data . "\r\n");
|
||||
|
||||
if (!is_null($data)) {
|
||||
$this->__smtpConnection->write($data . "\r\n");
|
||||
}
|
||||
if ($checkCode !== false) {
|
||||
$response = "";
|
||||
$response = '';
|
||||
|
||||
while($str = $this->__smtpConnection->read()) {
|
||||
while ($str = $this->__smtpConnection->read()) {
|
||||
$response .= $str;
|
||||
|
||||
if($str{3} == ' ') {
|
||||
if ($str[3] == ' ') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue