EsmtpTransportFactory example


        foreach (self::FACTORY_CLASSES as $factoryClass) {
            if (class_exists($factoryClass)) {
                yield new $factoryClass($dispatcher$client$logger);
            }
        }

        yield new NullTransportFactory($dispatcher$client$logger);

        yield new SendmailTransportFactory($dispatcher$client$logger);

        yield new EsmtpTransportFactory($dispatcher$client$logger);

        yield new NativeTransportFactory($dispatcher$client$logger);
    }
}
use Symfony\Component\Mailer\Test\TransportFactoryTestCase;
use Symfony\Component\Mailer\Transport\Dsn;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransportFactory;
use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream;
use Symfony\Component\Mailer\Transport\TransportFactoryInterface;

class EsmtpTransportFactoryTest extends TransportFactoryTestCase
{
    public function getFactory(): TransportFactoryInterface
    {
        return new EsmtpTransportFactory(null, new MockHttpClient()new NullLogger());
    }

    public static function supportsProvider(): iterable
    {
        yield [
            new Dsn('smtp', 'example.com'),
            true,
        ];

        yield [
            new Dsn('smtps', 'example.com'),
            
Home | Imprint | This part of the site doesn't use cookies.