equal
deleted
inserted
replaced
|
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 /** |
|
13 * Sends Messages over SMTP with ESMTP support. |
|
14 * @package Swift |
|
15 * @subpackage Transport |
|
16 * @author Chris Corbyn |
|
17 */ |
|
18 class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport |
|
19 { |
|
20 |
|
21 /** |
|
22 * Create a new SmtpTransport, optionally with $host, $port and $security. |
|
23 * @param string $host |
|
24 * @param int $port |
|
25 * @param int $security |
|
26 */ |
|
27 public function __construct($host = 'localhost', $port = 25, |
|
28 $security = null) |
|
29 { |
|
30 call_user_func_array( |
|
31 array($this, 'Swift_Transport_EsmtpTransport::__construct'), |
|
32 Swift_DependencyContainer::getInstance() |
|
33 ->createDependenciesFor('transport.smtp') |
|
34 ); |
|
35 |
|
36 $this->setHost($host); |
|
37 $this->setPort($port); |
|
38 $this->setEncryption($security); |
|
39 } |
|
40 |
|
41 /** |
|
42 * Create a new SmtpTransport instance. |
|
43 * @param string $host |
|
44 * @param int $port |
|
45 * @param int $security |
|
46 * @return Swift_SmtpTransport |
|
47 */ |
|
48 public static function newInstance($host = 'localhost', $port = 25, |
|
49 $security = null) |
|
50 { |
|
51 return new self($host, $port, $security); |
|
52 } |
|
53 |
|
54 } |