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

Breadcrumb

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

function SmtpTransport::parseMessageId

1 call to SmtpTransport::parseMessageId()
SmtpTransport::doSend in vendor/symfony/mailer/Transport/Smtp/SmtpTransport.php

File

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

Class

SmtpTransport
Sends emails over SMTP.

Namespace

Symfony\Component\Mailer\Transport\Smtp

Code

protected function parseMessageId(string $mtaResult) : string {
    $regexps = [
        '/250 Ok (?P<id>[0-9a-f-]+)\\r?$/mis',
        '/250 Ok:? queued as (?P<id>[A-Z0-9]+)\\r?$/mis',
    ];
    $matches = [];
    foreach ($regexps as $regexp) {
        if (preg_match($regexp, $mtaResult, $matches)) {
            return $matches['id'];
        }
    }
    return '';
}
RSS feed
Powered by Drupal