mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 17:16:18 +00:00
Fixed problem where already-authorized user was failing.
Added return of respond code found on success, allowing for more fine-grained post-query activity. git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7714 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
5c962accc1
commit
d5dbb7ba32
1 changed files with 13 additions and 10 deletions
|
@ -689,15 +689,17 @@ class EmailComponent extends Object{
|
|||
}
|
||||
|
||||
if (isset($this->smtpOptions['username']) && isset($this->smtpOptions['password'])) {
|
||||
if (!$this->__smtpSend('AUTH LOGIN', '334')) {
|
||||
return false;
|
||||
}
|
||||
$authRequired = $this->__smtpSend('AUTH LOGIN', '334|503');
|
||||
if ($authRequired == '334') {
|
||||
if (!$this->__smtpSend(base64_encode($this->smtpOptions['username']), '334')) {
|
||||
return false;
|
||||
}
|
||||
if (!$this->__smtpSend(base64_encode($this->smtpOptions['password']), '235')) {
|
||||
return false;
|
||||
}
|
||||
} elseif ($authRequired != '503') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->__smtpSend('MAIL FROM: ' . $this->__formatAddress($this->from, true))) {
|
||||
|
@ -748,11 +750,12 @@ class EmailComponent extends Object{
|
|||
if ($checkCode !== false) {
|
||||
$response = $this->__smtpConnection->read();
|
||||
|
||||
if (!preg_match('/^' . $checkCode . '/', $response)) {
|
||||
if (preg_match('/^(' . $checkCode . ')/', $response, $code)) {
|
||||
return $code[0];
|
||||
}
|
||||
$this->smtpError = $response;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue