Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RoundRobinTransport.php

function RoundRobinTransport::send

Overrides TransportInterface::send

File

vendor/symfony/mailer/Transport/RoundRobinTransport.php, line 47

Class

RoundRobinTransport
Uses several Transports using a round robin algorithm.

Namespace

Symfony\Component\Mailer\Transport

Code

public function send(RawMessage $message, ?Envelope $envelope = null) : ?SentMessage {
    $exception = null;
    while ($transport = $this->getNextTransport()) {
        try {
            return $transport->send($message, $envelope);
        } catch (TransportExceptionInterface $e) {
            $exception ??= new TransportException('All transports failed.');
            $exception->appendDebug(\sprintf("Transport \"%s\": %s\n", $transport, $e->getDebug()));
            $this->deadTransports[$transport] = microtime(true);
        }
    }
    throw $exception ?? new TransportException('No transports found.');
}
RSS feed
Powered by Drupal