protected function registerTransportSmtp()
{
$config = $this->getConfig();
/** @var $transport \Swift_SmtpTransport: */
$transport = $this->getDI()->get('\\Swift_SmtpTransport')->setHost($config['host'])->setPort($config['port']);
if (isset($config['encryption'])) {
$transport->setEncryption($config['encryption']);
}
if (isset($config['username'])) {
$transport->setUsername($this->normalizeEmail($config['username']));
$transport->setPassword($config['password']);
}
return $transport;
}