1: <?php
2:
3: /*
4: * This file is part of SwiftMailer.
5: * (c) 2004-2009 Chris Corbyn
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
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 string $security
24: */
25: public function __construct($host = 'localhost', $port = 25, $security = null)
26: {
27: call_user_func_array(
28: array($this, 'Swift_Transport_EsmtpTransport::__construct'),
29: Swift_DependencyContainer::getInstance()
30: ->createDependenciesFor('transport.smtp')
31: );
32:
33: $this->setHost($host);
34: $this->setPort($port);
35: $this->setEncryption($security);
36: }
37:
38: /**
39: * Create a new SmtpTransport instance.
40: * @param string $host
41: * @param int $port
42: * @param string $security
43: * @return Swift_SmtpTransport
44: */
45: public static function newInstance($host = 'localhost', $port = 25, $security = null)
46: {
47: return new self($host, $port, $security);
48: }
49: }
50: