def extract_email_id(email):
 from email.utils import parseaddr
 (fullname, email_id) = parseaddr(email)
 if (isinstance(email_id, basestring) and (not isinstance(email_id, unicode))):
  email_id = email_id.decode(u'utf-8', u'ignore')
 return email_id

def extract_email_id ( email ) : from email . utils import parseaddr ( fullname , email_id ) = parseaddr ( email ) if ( isinstance ( email_id , basestring ) and ( not isinstance ( email_id , unicode ) ) ) : email_id = email_id . decode ( u'utf-8' , u'ignore' ) return email_id
fetch only the email part of the email address .