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

http://zoop.googlecode.com/ · PHP · 48 lines · 17 code · 7 blank · 24 comment · 0 complexity · 6329232641ae803903f2129ea5fc055f 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/MailTransport.php';
  10. //@require 'Swift/DependencyContainer.php';
  11. /**
  12. * Sends Messages using the mail() function.
  13. * @package Swift
  14. * @subpackage Transport
  15. * @author Chris Corbyn
  16. */
  17. class Swift_MailTransport extends Swift_Transport_MailTransport
  18. {
  19. /**
  20. * Create a new MailTransport, optionally specifying $extraParams.
  21. * @param string $extraParams
  22. */
  23. public function __construct($extraParams = '-f%s')
  24. {
  25. call_user_func_array(
  26. array($this, 'Swift_Transport_MailTransport::__construct'),
  27. Swift_DependencyContainer::getInstance()
  28. ->createDependenciesFor('transport.mail')
  29. );
  30. $this->setExtraParams($extraParams);
  31. }
  32. /**
  33. * Create a new MailTransport instance.
  34. * @param string $extraParams To be passed to mail()
  35. * @return Swift_MailTransport
  36. */
  37. public static function newInstance($extraParams = '-f%s')
  38. {
  39. return new self($extraParams);
  40. }
  41. }