Create an instance of the Log Swift Transport driver.

@return \Illuminate\Mail\Transport\LogTransport
766157
protected function createLogDriver()
    {
        $logger = $this->app->make(LoggerInterface::class);

        if ($logger instanceof LogManager) {
            $logger = $logger->channel($this->app['config']['mail.log_channel']);
        }

        return new LogTransport($logger);
    }
973839
public function create()
    {
        foreach ($this->driverClasses as $driverClass) {
            try {
                $driver = new $driverClass();

                return $driver;
            } catch (\Exception $e) {
            }
        }

        return null;
    }
1000065
private function transport()
    {
        $this->transport = Transport::newInstance($this->smtp->get('host'), $this->smtp->get('port'), $this->smtp->get('encryption'))
            ->setUsername($this->smtp->get('username'))
            ->setPassword($this->smtp->get('password'));

        return $this->transport;
    }
31531
protected function createMandrillDriver()
    {
        $config = $this->app['config']->get('services.mandrill', []);

        return new MandrillTransport(
            $this->guzzle($config), $config['secret']
        );
    }
24424
protected function createSparkPostDriver()
	{
		$config = Config::get( 'services.sparkpost', [] );

		return new SparkPostTransport( $this->getHttpClient( $config ), $config['secret'], Arr::get( $config, 'options', [] ) );
	}
640514
protected function createAuthLog()
    {
        $request = $this->requestStack->getCurrentRequest();

        /** @var XM\SecurityBundle\Entity\AuthLog $authLog */
        $authLog = new $this->authLogClass();
        $authLog->setDatetime(new \DateTimeImmutable());
        $authLog->setUserAgent($request->headers->get('User-Agent'));
        $authLog->setIpAddress($request->getClientIp());

        return $authLog;
    }
1289578
public function send()
    {

        if ($this->Logger->isEnabled()) {

            $this->Logger->debug($this->message->toString());

        }


        //Now check if Swift actually sends it
        if (!$this->testingOnly) {

            //Now check if Swift actually sends it
            $this->getMailer()->send($this->message);

        }
        return $this;

    }
561653
protected function createSmtpDriver()
    {
        $config = $this->app->make('config')->get('mail');

        // The Swift SMTP transport instance will allow us to use any SMTP backend
        // for delivering mail such as Sendgrid, Amazon SES, or a custom server
        // a developer has available. We will just pass this configured host.
        $transport = new SmtpTransport($config['host'], $config['port']);

        if (isset($config['encryption'])) {
            $transport->setEncryption($config['encryption']);
        }

        // Once we have the transport we will check for the presence of a username
        // and password. If we have it we will set the credentials on the Swift
        // transporter instance so that we'll properly authenticate delivery.
        if (isset($config['username'])) {
            $transport->setUsername($config['username']);

            $transport->setPassword($config['password']);
        }

        // Next we will set any stream context options specified for the transport
        // and then return it. The option is not required any may not be inside
        // the configuration array at all so we'll verify that before adding.
        if (isset($config['stream'])) {
            $transport->setStreamOptions($config['stream']);
        }

        return $transport;
    }
706816
public function factory()
    {
        $method = $class = null;
        $class = __NAMESPACE__.'\\'.$this->drivers[$this->config['driver']];

        $name = $this->getName();
        if ($name != 'cygnite-session' && !is_null($this->cacheLimiter())) {
            $session = new $class($name, $this->cacheLimiter(), $this);
        } else {
            $session = new $class($this->name, null, $this);
        }

        return $session;
    }
1096627
private function createLogger(): LoggerInterface
    {
        $container = ContainerScope::getContainer();
        if (empty($container) || !$container->has(LogsInterface::class)) {
            return new NullLogger();
        }

        //We are using class name as log channel (name) by default
        return $container->get(LogsInterface::class)->getLogger(static::class);
    }
385652
protected function client()
    {
        $handlerClass = $this->config('handlerClass');
        $level = $this->config('level');
        $stream = $this->config('stream');
        $log = new Logger($this->config('name'));
        $log->pushHandler(new $handlerClass($stream, $level));

        return $log;
    }
976429
private function getMailer(): \Swift_Mailer
    {
        // If the mailer has already been defined via the constructor, return it.
        if ($this->mailer) {
            return $this->mailer;
        }

        // Get the proper transporter
        switch ($this->config('mailer.transport')) {
            case 'smtp':
                $transport = $this->getSmtpTransport();

                break;

            case 'mail':
                throw new MailerException(
                    "'mail' transport is no longer supported, please use 'smtp' or 'sendmail' transport."
                );

                break;

            default:
                $transport = $this->getSendMailTransport();
        }

        $this->mailer = new \Swift_Mailer($transport);

        return $this->mailer;
    }
345602
public function createMessage() {
		$prefs = $this->getPreferenceLoader()->getSystemPreferences();

		$message = new Swift_Message();
		$sender = $prefs->getPlattformEmail();
		if (!empty($sender)) {
			$message->setFrom($prefs->getPlattformEmail(), $prefs->getPlattformName());
		}

		return $message;
	}
1361521
public function create($transport)
    {
        if (is_string($transport)) {
            $transport = $this->registry->getTransport($transport);
        }

        if (!$transport instanceof TransportInterface) {
            throw new \InvalidArgumentException('transport should a string or a TransportInterface');
        }

        // If MonologExtension loaded, we inject its logger in Jobflow
        if (null !== ($extension = $this->registry->getExtension('Rezzza\Jobflow\Extension\Monolog\MonologExtension'))) {
            $this->logger = $extension->getLogger();
        }

        return new Jobflow(
            $transport,
            $this->jobFactory,
            new JobMessageFactory,
            new JobContextFactory,
            new ExecutionContextFactory,
            null,
            $this->logger
        );
    }
763274
public function createSendmailDriver($sendmail = null)
    {
        $transport = Swift_SendmailTransport::newInstance(
            $sendmail ? $sendmail : Config::get('sendmail')
        );

        return $transport;
    }
1338548
public function init()
    {
        if (!class_exists('Swift_MailTransport')) {
            throw new \Exception('SwiftMailer need to be installed');
        }
        $transport = null;
        switch ($this->config['transport']) {
            case self::TRANSPORT_SENDMAIL:
                $transport = new \Swift_SendmailTransport();
                break;
            case self::TRANSPORT_SMTP:
                $transport = (new \Swift_SmtpTransport(isset($this->config['host'])
                            ? $this->config['host'] : 'localhost',
                    isset($this->config['port']) ? $this->config['port'] : 25,
                    isset($this->config['security']) ? $this->config['security']
                            : ''))
                    ->setUsername($this->config['username'])
                    ->setPassword($this->config['password']);
                break;
            case self::TRANSPORT_MAIL:
            default:
                $transport = new \Swift_MailTransport();
        }
        $this->mailer = new \Swift_Mailer($transport);
        return $this;
    }
538606
private function createDriver()
    {
        if (is_string($this->config['driver'])) {
            $drivername = ucfirst($this->config['driver']);
            $driverclass = sprintf('Intervention\\Image\\%s\\Driver', $drivername);

            if (class_exists($driverclass)) {
                return new $driverclass;
            }

            throw new \Intervention\Image\Exception\NotSupportedException(
                "Driver ({$drivername}) could not be instantiated."
            );
        }

        if ($this->config['driver'] instanceof AbstractDriver) {
            return $this->config['driver'];
        }

        throw new \Intervention\Image\Exception\NotSupportedException(
            "Unknown driver type."
        );
    }