Default CharSet to UTF-8 if we are using UTF-8 addresses and the validator has not been changed.

This commit is contained in:
Marcus Bointon 2025-03-27 15:37:05 +01:00
parent 29a04c283a
commit ddebeb0565
No known key found for this signature in database
GPG Key ID: DE31CD6EB646AA24
1 changed files with 1 additions and 1 deletions

View File

@ -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'])) {