MailTransport.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 using the mail() function.
  11. *
  12. * @author Chris Corbyn
  13. */
  14. class Swift_MailTransport extends Swift_Transport_MailTransport
  15. {
  16. /**
  17. * Create a new MailTransport, optionally specifying $extraParams.
  18. *
  19. * @param string $extraParams
  20. */
  21. public function __construct($extraParams = '-f%s')
  22. {
  23. call_user_func_array(
  24. array($this, 'Swift_Transport_MailTransport::__construct'),
  25. Swift_DependencyContainer::getInstance()
  26. ->createDependenciesFor('transport.mail')
  27. );
  28. $this->setExtraParams($extraParams);
  29. }
  30. /**
  31. * Create a new MailTransport instance.
  32. *
  33. * @param string $extraParams To be passed to mail()
  34. *
  35. * @return Swift_MailTransport
  36. */
  37. public static function newInstance($extraParams = '-f%s')
  38. {
  39. return new self($extraParams);
  40. }
  41. }