(address, encoding='utf-8')
return formataddr((name, addr))
Process one email address.

    :param address: email from-address string
Process one email address.
Process one email address .
def process_address(address, encoding='utf-8'):
    """Process one email address.

    :param address: email from-address string
    """
    name, addr = parseaddr(force_text(address, encoding))

    try:
        name = Header(name, encoding).encode()
    except UnicodeEncodeError:
        name = Header(name, 'utf-8').encode()
    try:
        addr.encode('ascii')
    except UnicodeEncodeError:
        if '@' in addr:
            localpart, domain = addr.split('@', 1)
            localpart = str(Header(localpart, encoding))
            domain = domain.encode('idna').decode('ascii')
            addr = '@'.join([localpart, domain])
        else:
            addr = Header(addr, encoding).encode()
    return formataddr((name, addr))
def process_address ( address , encoding = 'utf-8' ) : name , addr = parseaddr ( force_text ( address , encoding ) ) try : name = Header ( name , encoding ) . encode ( ) except UnicodeEncodeError : name = Header ( name , 'utf-8' ) . encode ( ) try : addr . encode ( 'ascii' ) except UnicodeEncodeError : if '@' in addr : localpart , domain = addr . split ( '@' , 1 ) localpart = str ( Header ( localpart , encoding ) ) domain = domain . encode ( 'idna' ) . decode ( 'ascii' ) addr = '@' . join ( [ localpart , domain ] ) else : addr = Header ( addr , encoding ) . encode ( ) return formataddr ( ( name , addr ) )