Transport.php 1.2 KB

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