SmtpAgent.php 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of SwiftMailer.
  4. * (c) 2004-2009 Chris Corbyn
  5. *
  6. * For the full copyright and license information, please view the LICENSE
  7. * file that was distributed with this source code.
  8. */
  9. /**
  10. * Wraps an IoBuffer to send/receive SMTP commands/responses.
  11. *
  12. * @package Swift
  13. * @subpackage Transport
  14. * @author Chris Corbyn
  15. */
  16. interface Swift_Transport_SmtpAgent
  17. {
  18. /**
  19. * Get the IoBuffer where read/writes are occurring.
  20. *
  21. * @return Swift_Transport_IoBuffer
  22. */
  23. public function getBuffer();
  24. /**
  25. * Run a command against the buffer, expecting the given response codes.
  26. *
  27. * If no response codes are given, the response will not be validated.
  28. * If codes are given, an exception will be thrown on an invalid response.
  29. *
  30. * @param string $command
  31. * @param int[] $codes
  32. * @param string[] $failures An array of failures by-reference
  33. */
  34. public function executeCommand($command, $codes = array(), &$failures = null);
  35. }