src/Mailer.php
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;
    }
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;
    }
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 ; }
Return the proper mailer.

@throws MailerException
Return the proper mailer .