[-] Classes : #PSCFI-4931 : BugFix Better encoding for accentuated chars in mails headers

This commit is contained in:
Francois Gaillard committed 2012-03-13 09:48:04 +00:00
1 parent 277f35ea5f
commit ad478dfc09
1 file changed
+3 -2
+3 -2
View File
@@ -117,14 +117,15 @@ class MailCore
if ($toName && is_array($toName) && Validate::isGenericName($toName[$key])) if ($toName && is_array($toName) && Validate::isGenericName($toName[$key]))
$to_name = $toName[$key]; $to_name = $toName[$key];
} }
$to_list->addTo($addr, base64_encode($to_name)); /* Encode accentuated chars */
$to_list->addTo($addr, '=?UTF-8?B?'.base64_encode($to_name).'?=');
} }
$to_plugin = $to[0]; $to_plugin = $to[0];
$to = $to_list; $to = $to_list;
} else { } else {
/* Simple recipient, one address */ /* Simple recipient, one address */
$to_plugin = $to; $to_plugin = $to;
$to = new Swift_Address($to, base64_encode($toName)); $to = new Swift_Address($to, '=?UTF-8?B?'.base64_encode($toName).'?=');
} }
try { try {
/* Connect with the appropriate configuration */ /* Connect with the appropriate configuration */