src/Viserio/Component/Mail/Provider/MailServiceProvider.php
public static function createMailManager(ContainerInterface $container): MailManager
    {
        $manager = new MailManager($container->get('config'), $container->get(TransportFactory::class));
        $manager->setContainer($container);

        if ($container->has(ViewFactoryContract::class)) {
            $manager->setViewFactory($container->get(ViewFactoryContract::class));
        }

        if ($container->has(EventManagerContract::class)) {
            $manager->setEventManager($container->get(EventManagerContract::class));
        }

        return $manager;
    }
public static function createMailManager(ContainerInterface $container): MailManager
    {
        $manager = new MailManager($container->get('config'), $container->get(TransportFactory::class));
        $manager->setContainer($container);

        if ($container->has(ViewFactoryContract::class)) {
            $manager->setViewFactory($container->get(ViewFactoryContract::class));
        }

        if ($container->has(EventManagerContract::class)) {
            $manager->setEventManager($container->get(EventManagerContract::class));
        }

        return $manager;
    }
Create a new swift mailer manager.

@param \Psr\Container\ContainerInterface $container

@return \Viserio\Component\Mail\MailManager