Skip to content

[Mailer] Cannot create a failover/roundrobin transport using Transport::fromDsn #37158

Closed
@atailouloute

Description

@atailouloute

Symfony version(s) affected: 4.4+

Description
Using the static method Transport::fromDsn we can't create a multiple transport (failover or roundrobin).

How to reproduce

<?php

use Symfony\Component\Mailer\Transport;

require_once __DIR__ . '/vendor/autoload.php';

$transport = Transport::fromDsn('failover(smtp://localhost:1025 smtp://localhost:1026)');

// Expected result:
// ----------------
// A FailoverTransport instance with 2 transports EsmtpTransport

// Actual result:
// -------------
// Uncaught Exception: Cannot rewind a generator that was already run in ... vendor/symfony/mailer/Transport.php:143

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions