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\TransportCode
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.');
}