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

http://zoop.googlecode.com/ · PHP · 56 lines · 21 code · 7 blank · 28 comment · 0 complexity · c605eb1137ca859e370ed4f8d67dad1a 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/EsmtpTransport.php';
  10. //@require 'Swift/DependencyContainer.php';
  11. /**
  12. * Sends Messages over SMTP with ESMTP support.
  13. * @package Swift
  14. * @subpackage Transport
  15. * @author Chris Corbyn
  16. */
  17. class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport
  18. {
  19. /**
  20. * Create a new SmtpTransport, optionally with $host, $port and $security.
  21. * @param string $host
  22. * @param int $port
  23. * @param int $security
  24. */
  25. public function __construct($host = 'localhost', $port = 25,
  26. $security = null)
  27. {
  28. call_user_func_array(
  29. array($this, 'Swift_Transport_EsmtpTransport::__construct'),
  30. Swift_DependencyContainer::getInstance()
  31. ->createDependenciesFor('transport.smtp')
  32. );
  33. $this->setHost($host);
  34. $this->setPort($port);
  35. $this->setEncryption($security);
  36. }
  37. /**
  38. * Create a new SmtpTransport instance.
  39. * @param string $host
  40. * @param int $port
  41. * @param int $security
  42. * @return Swift_SmtpTransport
  43. */
  44. public static function newInstance($host = 'localhost', $port = 25,
  45. $security = null)
  46. {
  47. return new self($host, $port, $security);
  48. }
  49. }