/framework/vendor/swift/lib/classes/Swift/SendmailTransport.php

http://zoop.googlecode.com/ · PHP · 48 lines · 17 code · 7 blank · 24 comment · 0 complexity · e0aab6ad6862061a474f21e622f98f85 MD5 · raw file

  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. //@require 'Swift/Transport/SendmailTransport.php';
  10. //@require 'Swift/DependencyContainer.php';
  11. /**
  12. * SendmailTransport for sending mail through a sendmail/postfix (etc..) binary.
  13. * @package Swift
  14. * @subpackage Transport
  15. * @author Chris Corbyn
  16. */
  17. class Swift_SendmailTransport extends Swift_Transport_SendmailTransport
  18. {
  19. /**
  20. * Create a new SendmailTransport, optionally using $command for sending.
  21. * @param string $command
  22. */
  23. public function __construct($command = '/usr/sbin/sendmail -bs')
  24. {
  25. call_user_func_array(
  26. array($this, 'Swift_Transport_SendmailTransport::__construct'),
  27. Swift_DependencyContainer::getInstance()
  28. ->createDependenciesFor('transport.sendmail')
  29. );
  30. $this->setCommand($command);
  31. }
  32. /**
  33. * Create a new SendmailTransport instance.
  34. * @param string $command
  35. * @return Swift_SendmailTransport
  36. */
  37. public static function newInstance($command = '/usr/sbin/sendmail -bs')
  38. {
  39. return new self($command);
  40. }
  41. }