Transport.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. * Sends Messages via an abstract Transport subsystem.
  11. *
  12. * @package Swift
  13. * @subpackage Transport
  14. * @author Chris Corbyn
  15. */
  16. interface Swift_Transport
  17. {
  18. /**
  19. * Test if this Transport mechanism has started.
  20. *
  21. * @return boolean
  22. */
  23. public function isStarted();
  24. /**
  25. * Start this Transport mechanism.
  26. */
  27. public function start();
  28. /**
  29. * Stop this Transport mechanism.
  30. */
  31. public function stop();
  32. /**
  33. * Send the given Message.
  34. *
  35. * Recipient/sender data will be retrieved from the Message API.
  36. * The return value is the number of recipients who were accepted for delivery.
  37. *
  38. * @param Swift_Mime_Message $message
  39. * @param string[] &$failedRecipients to collect failures by-reference
  40. * @return int
  41. */
  42. public function send(Swift_Mime_Message $message, &$failedRecipients = null);
  43. /**
  44. * Register a plugin in the Transport.
  45. *
  46. * @param Swift_Events_EventListener $plugin
  47. */
  48. public function registerPlugin(Swift_Events_EventListener $plugin);
  49. }