TYPO3 API  SVNRelease
SmtpTransport.php
Go to the documentation of this file.
00001 <?php
00002 
00003 /*
00004  * This file is part of SwiftMailer.
00005  * (c) 2004-2009 Chris Corbyn
00006  *
00007  * For the full copyright and license information, please view the LICENSE
00008  * file that was distributed with this source code.
00009  */
00010 
00011 //@require 'Swift/Transport/EsmtpTransport.php';
00012 //@require 'Swift/DependencyContainer.php';
00013 
00014 /**
00015  * Sends Messages over SMTP with ESMTP support.
00016  * @package Swift
00017  * @subpackage Transport
00018  * @author Chris Corbyn
00019  */
00020 class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport
00021 {
00022 
00023   /**
00024    * Create a new SmtpTransport, optionally with $host, $port and $security.
00025    * @param string $host
00026    * @param int $port
00027    * @param int $security
00028    */
00029   public function __construct($host = 'localhost', $port = 25,
00030     $security = null)
00031   {
00032     call_user_func_array(
00033       array($this, 'Swift_Transport_EsmtpTransport::__construct'),
00034       Swift_DependencyContainer::getInstance()
00035         ->createDependenciesFor('transport.smtp')
00036       );
00037 
00038     $this->setHost($host);
00039     $this->setPort($port);
00040     $this->setEncryption($security);
00041   }
00042 
00043   /**
00044    * Create a new SmtpTransport instance.
00045    * @param string $host
00046    * @param int $port
00047    * @param int $security
00048    * @return Swift_SmtpTransport
00049    */
00050   public static function newInstance($host = 'localhost', $port = 25,
00051     $security = null)
00052   {
00053     return new self($host, $port, $security);
00054   }
00055 
00056 }