Common\Mailer\TransportFactory::create PHP Méthode

create() public static méthode

Create The right transport instance based on some settings
public static create ( string $type = 'mail', string $server = null, integer $port = 25, string $user = null, string $pass = null, string $encryption = null ) : Swift_Transport
$type string
$server string
$port integer
$user string
$pass string
$encryption string
Résultat Swift_Transport
    public static function create($type = 'mail', $server = null, $port = 25, $user = null, $pass = null, $encryption = null)
    {
        if ($type === 'smtp') {
            return self::getSmtpTransport($server, $port, $user, $pass, $encryption);
        } else {
            return self::getMailTransport();
        }
    }

Usage Example

 public function testEncryptionCanBeSet()
 {
     $transport = TransportFactory::create('smtp', null, null, null, null, 'ssl');
     $this->assertEquals('ssl', $transport->getEncryption());
     $transport = TransportFactory::create('smtp', null, null, null, null, 'tls');
     $this->assertEquals('tls', $transport->getEncryption());
 }
All Usage Examples Of Common\Mailer\TransportFactory::create