diff --git a/core/lib/Drupal/Core/Mail/MailManager.php b/core/lib/Drupal/Core/Mail/MailManager.php index 7e1bd9de46..348dceeb20 100644 --- a/core/lib/Drupal/Core/Mail/MailManager.php +++ b/core/lib/Drupal/Core/Mail/MailManager.php @@ -249,9 +249,11 @@ public function doMail($module, $key, $to, $langcode, $params = [], $reply = NUL // Return-Path headers should have a domain authorized to use the // originating SMTP server. $headers['Sender'] = $headers['Return-Path'] = $site_mail; - // Headers are encoded in MailManager::doMail(). The site name must be - // encoded here to prevent doMail() from encoding the email address, which - // would break the header. + // Headers are usually encoded in the mail plugin that implements + // \Drupal\Core\Mail\MailInterface::mail(), for example, + // \Drupal\Core\Mail\Plugin\Mail\PhpMail::mail(). The site name must be + // encoded here to prevent mail plugins from encoding the email address, + // which would break the header. $headers['From'] = Unicode::mimeHeaderEncode($site_config->get('name'), TRUE) . ' <' . $site_mail . '>'; if ($reply) { $headers['Reply-to'] = $reply;