Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
atailouloute opened this issue Jun 8, 2020 · 0 comments

Comments

@atailouloute
Copy link
Contributor

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
@fabpot fabpot closed this as completed Jun 9, 2020
fabpot added a commit that referenced this issue Jun 9, 2020
…orts using Transport::fromDsn (atailouloute)

This PR was submitted for the master branch but it was merged into the 4.4 branch instead.

Discussion
----------

[Mailer] Fixed generator bug when creating multiple transports using Transport::fromDsn

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       |  #37158
| License       | MIT
| Doc PR        | N/A

Commits
-------

c5833fa [Mailer] Fixed generator bug when creating multiple transports using Transport::fromDsn
@xabbuh xabbuh added the Mailer label Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants