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

Breadcrumb

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

function SmtpTransport::send

Overrides AbstractTransport::send

File

vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php, line 135

Class

SmtpTransport
Sends emails over SMTP.

Namespace

Symfony\Component\Mailer\Transport\Smtp

Code

public function send(RawMessage $message, ?Envelope $envelope = null) : ?SentMessage {
    try {
        $message = parent::send($message, $envelope);
    } catch (TransportExceptionInterface $e) {
        if ($this->started) {
            try {
                $this->executeCommand("RSET\r\n", [
                    250,
                ]);
            } catch (TransportExceptionInterface) {
                // ignore this exception as it probably means that the server error was final
            }
        }
        throw $e;
    }
    $this->checkRestartThreshold();
    return $message;
}
RSS feed
Powered by Drupal