src/Utils/SwiftMailer/SendmailTransportMailerFactory.php
public static function factory(SwiftMailerConfigurationInterface $swiftMailerConfiguration)
    {

        // load the transport configuration
        $transportConfiguration = $swiftMailerConfiguration->getTransport();

        // load the transport factory
        $transportFactory = $transportConfiguration->getTransportFactory();

        // initialize and load the sendmail command parameter
        $command = '/usr/sbin/sendmail -bs';
        if ($transportConfiguration->hasParam(SwiftMailerKeys::COMMAND)) {
            $command = $transportConfiguration->getParam(SwiftMailerKeys::COMMAND);
        }

        // initialize and create the mailer transport instance
        $transport = $transportFactory::newInstance($command);

        // load the mailer factory
        $mailerFactory = $swiftMailerConfiguration->getMailerFactory();

        // initialize, create and return the swift mailer instance
        return $mailerFactory::newInstance($transport);
    }
public static function factory(SwiftMailerConfigurationInterface $swiftMailerConfiguration)
    {

        // load the transport configuration
        $transportConfiguration = $swiftMailerConfiguration->getTransport();

        // load the transport factory
        $transportFactory = $transportConfiguration->getTransportFactory();

        // initialize and load the sendmail command parameter
        $command = '/usr/sbin/sendmail -bs';
        if ($transportConfiguration->hasParam(SwiftMailerKeys::COMMAND)) {
            $command = $transportConfiguration->getParam(SwiftMailerKeys::COMMAND);
        }

        // initialize and create the mailer transport instance
        $transport = $transportFactory::newInstance($command);

        // load the mailer factory
        $mailerFactory = $swiftMailerConfiguration->getMailerFactory();

        // initialize, create and return the swift mailer instance
        return $mailerFactory::newInstance($transport);
    }
Creates a new swift mailer instance based on the passed configuration.

@param \TechDivision\Import\Configuration\SwiftMailerConfigurationInterface $swiftMailerConfiguration The mailer configuration

@return \Swift_Mailer The mailer instance