Skip to content

Commit fe31757

Browse files
committed
ACP2E-717: Emails are not sent for the email containing ".-"
1 parent 44f6a52 commit fe31757

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/internal/Magento/Framework/Mail/AddressConverter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,14 @@ private function convertEmailUserToAscii(string $email): string
6060
if (preg_match('/^(.+)@([^@]+)$/', $email, $matches)) {
6161
$user = $matches[1];
6262
$hostname = $matches[2];
63-
$userEncoded = idn_to_ascii($user, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46);
63+
$userEncoded = idn_to_ascii($user, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46, $idnaInfo);
6464
if ($userEncoded == $user) {
6565
return $email;
6666
}
67+
68+
if ($userEncoded === false && array_key_exists('result', $idnaInfo)) {
69+
$userEncoded = $idnaInfo['result'];
70+
}
6771
$email = sprintf('%s@%s', $userEncoded, $hostname);
6872
}
6973
return $email;

0 commit comments

Comments
 (0)