Swift_Transport_Esmtp_AuthHandler::afterEhlo PHP 메소드

afterEhlo() 공개 메소드

Runs immediately after a EHLO has been issued.
public afterEhlo ( Swift_Transport_SmtpAgent $agent )
$agent Swift_Transport_SmtpAgent to read/write
    public function afterEhlo(Swift_Transport_SmtpAgent $agent)
    {
        if ($this->_username) {
            $count = 0;
            foreach ($this->_getAuthenticatorsForAgent() as $authenticator) {
                if (in_array(strtolower($authenticator->getAuthKeyword()), array_map('strtolower', $this->_esmtpParams))) {
                    ++$count;
                    if ($authenticator->authenticate($agent, $this->_username, $this->_password)) {
                        return;
                    }
                }
            }
            throw new Swift_TransportException('Failed to authenticate on SMTP server with username "' . $this->_username . '" using ' . $count . ' possible authenticators');
        }
    }