From ddebeb0565cf34b37689f5bbb248d308bf0ecb0d Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Thu, 27 Mar 2025 15:37:05 +0100 Subject: [PATCH] Default CharSet to UTF-8 if we are using UTF-8 addresses and the validator has not been changed. --- src/PHPMailer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PHPMailer.php b/src/PHPMailer.php index 4c406b17..5b71cdca 100644 --- a/src/PHPMailer.php +++ b/src/PHPMailer.php @@ -1173,10 +1173,10 @@ class PHPMailer protected function addAnAddress($kind, $address, $name = '') { if ( - $this->CharSet === self::CHARSET_UTF8 && self::$validator === 'php' && $this->addressHasUnicodeLocalPart($address) ) { + $this->CharSet = self::CHARSET_UTF8; self::$validator = 'eai'; } if (!in_array($kind, ['to', 'cc', 'bcc', 'Reply-To'])) {