public static function getTransport($host, $port, $encryption, $username, $password)
    {
        if (empty($host)) {
            throw new InternalServerErrorException("Missing SMTP host. Check service configuration.");
        }
        if (empty($port)) {
            throw new InternalServerErrorException("Missing SMTP port. Check service configuration.");
        }
        $transport = new SmtpTransport($host, $port);

        if (!empty($encryption)) {
            $transport->setEncryption($encryption);
        }

        if (!empty($username) && !empty($password)) {
            $transport->setUsername($username);
            $transport->setPassword($password);
        }

        return $transport;
    }
public static function getTransport($host, $port, $encryption, $username, $password)
    {
        if (empty($host)) {
            throw new InternalServerErrorException("Missing SMTP host. Check service configuration.");
        }
        if (empty($port)) {
            throw new InternalServerErrorException("Missing SMTP port. Check service configuration.");
        }
        $transport = new SmtpTransport($host, $port);

        if (!empty($encryption)) {
            $transport->setEncryption($encryption);
        }

        if (!empty($username) && !empty($password)) {
            $transport->setUsername($username);
            $transport->setPassword($password);
        }

        return $transport;
    }
@param $host
@param $port
@param $encryption
@param $username
@param $password

@return \Swift_SmtpTransport
@throws \DreamFactory\Core\Exceptions\InternalServerErrorException