Swift_Transport_SmtpAgent::executeCommand PHP Method

executeCommand() public method

If no response codes are given, the response will not be validated. If codes are given, an exception will be thrown on an invalid response.
public executeCommand ( string $command, int[] $codes = [], string[] &$failures = null )
$command string
$codes int[]
$failures string[] An array of failures by-reference
    public function executeCommand($command, $codes = array(), &$failures = null);

Usage Example

Exemplo n.º 1
0
 /**
  * Try to authenticate the user with $email and $token.
  *
  * @param Swift_Transport_SmtpAgent $agent
  * @param string                    $email
  * @param string                    $token
  *
  * @return bool
  */
 public function authenticate(Swift_Transport_SmtpAgent $agent, $email, $token)
 {
     try {
         $param = $this->constructXOAuth2Params($email, $token);
         $agent->executeCommand("AUTH XOAUTH2 " . $param . "\r\n", array(235));
         return true;
     } catch (Swift_TransportException $e) {
         $agent->executeCommand("RSET\r\n", array(250));
         return false;
     }
 }
All Usage Examples Of Swift_Transport_SmtpAgent::executeCommand
Swift_Transport_SmtpAgent