public static function getTransport($mailer)
    {
        $config = Mailer::getConfig()->get($mailer);
        if (!$config) {
            throw new MailerException(MailerException::INVALID_CONFIGURATION, [$mailer]);
        }

        $lib = self::getLibrary($mailer);

        /* @var MailerInterface $libInstance */
        $libInstance = self::factory($lib, MailerInterface::class);

        $instance = $libInstance::getTransport($config);
        if (!self::isInstanceOf($instance, TransportInterface::class)) {
            throw new MailerException(MailerException::TRANSPORT_INTERFACE);
        }

        return $instance;
    }