Added feature #15998: Create a new API to send mails based on SwiftMailer to replace...
[Packages/TYPO3.CMS.git] / typo3 / contrib / swiftmailer / classes / Swift / SmtpTransport.php
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 //@require 'Swift/Transport/EsmtpTransport.php';
12 //@require 'Swift/DependencyContainer.php';
13
14 /**
15 * Sends Messages over SMTP with ESMTP support.
16 * @package Swift
17 * @subpackage Transport
18 * @author Chris Corbyn
19 */
20 class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport
21 {
22
23 /**
24 * Create a new SmtpTransport, optionally with $host, $port and $security.
25 * @param string $host
26 * @param int $port
27 * @param int $security
28 */
29 public function __construct($host = 'localhost', $port = 25,
30 $security = null)
31 {
32 call_user_func_array(
33 array($this, 'Swift_Transport_EsmtpTransport::__construct'),
34 Swift_DependencyContainer::getInstance()
35 ->createDependenciesFor('transport.smtp')
36 );
37
38 $this->setHost($host);
39 $this->setPort($port);
40 $this->setEncryption($security);
41 }
42
43 /**
44 * Create a new SmtpTransport instance.
45 * @param string $host
46 * @param int $port
47 * @param int $security
48 * @return Swift_SmtpTransport
49 */
50 public static function newInstance($host = 'localhost', $port = 25,
51 $security = null)
52 {
53 return new self($host, $port, $security);
54 }
55
56 }