setEnhancedSmtpCode() public method

Set SMTP Enhanced Mail System Status Code (RFC 3463).
public setEnhancedSmtpCode ( string $code )
$code string Enhanced status code.
Example #1
0
 /**
  * Gets a line from the incoming stream and parses it.
  *
  * @param mixed $code    Expected reply code(s) (integer or array).
  * @param string $error  On error, 'logout' or 'reset'?
  *
  * @return array  An array with the response text.
  * @throws Horde_Smtp_Exception
  */
 protected function _getResponse($code, $error = null)
 {
     $text = array();
     while ($read = $this->_connection->read()) {
         $read = trim(rtrim($read, "\r\n"));
         $replycode = intval(substr($read, 0, 3));
         $text[] = ltrim(substr($read, 4));
         if ($read[3] != '-') {
             break;
         }
     }
     if (!is_array($code)) {
         $code = array($code);
     }
     if (in_array($replycode, $code)) {
         return $text;
     }
     /* Check for enhanced status codes (RFC 2034). */
     $details = reset($text);
     if (!is_null($this->_extensions) && $this->queryExtension('ENHANCEDSTATUSCODES')) {
         list($enhanced, $details) = explode(' ', $details, 2);
     } else {
         $enhanced = null;
     }
     $e = new Horde_Smtp_Exception($details);
     $e->details = $details;
     $e->setSmtpCode($replycode);
     $e->setEnhancedSmtpCode($enhanced);
     switch ($error) {
         case 'logout':
             $this->logout();
             break;
         case 'reset':
             /* RFC 3207: If we see 530, no need to send reset command. */
             if ($code != 530) {
                 $this->resetCmd();
             }
             break;
     }
     throw $e;
 }