src/Mime/Mime.php
public static function encodeEmail($email)
    {
        if (($pos = strpos($email, '@')) === false) {
            return;
        }
        if (!preg_match('~[\x80-\xFF]~', $email)) {
            return $email;
        }
        $domain = substr($email, ++$pos);
        return substr($email, 0, $pos) . idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
    }
public static function encodeEmail($email)
    {
        if (($pos = strpos($email, '@')) === false) {
            return;
        }
        if (!preg_match('~[\x80-\xFF]~', $email)) {
            return $email;
        }
        $domain = substr($email, ++$pos);
        return substr($email, 0, $pos) . idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
    }
public static function encodeEmail ( $ email ) { if ( ( $ pos = strpos ( $ email , '@' ) ) === false ) { return ; } if ( ! preg_match ( '~[\x80-\xFF]~' , $ email ) ) { return $ email ; } $ domain = substr ( $ email , ++ $ pos ) ; return substr ( $ email , 0 , $ pos ) . idn_to_ascii ( $ domain , 0 , INTL_IDNA_VARIANT_UTS46 ) ; }
Punycode email address to its ASCII form, also known as punycode.

@param  string      $email The email address to encode
@return string|null        The encoded address in ASCII form or `null` on error.
Punycode email address to its ASCII form also known as punycode .