/** * @return Horde_Mail_Transport */ public function createTransport() { $transport = $this->config->getSystemValue('app.mail.transport', 'smtp'); if ($transport === 'php-mail') { return new Horde_Mail_Transport_Mail(); } $password = $this->account->getOutboundPassword(); $password = $this->crypto->decrypt($password); $params = ['host' => $this->account->getOutboundHost(), 'password' => $password, 'port' => $this->account->getOutboundPort(), 'username' => $this->account->getOutboundUser(), 'secure' => $this->convertSslMode($this->account->getOutboundSslMode()), 'timeout' => 2]; return new Horde_Mail_Transport_Smtphorde($params); }