mail addresses

phansen peter at engcorp.com
Thu Sep 16 10:35:11 EDT 2004


Michele Simionato wrote:
> Suppose I have an email.Message object.
> I can extract the sender by using ["From"]. However sometimes I
> get addresses in the form
> 
> John Doe <john.doe at somedomain.com>
> 
> sometimes I get addresses in the form
> 
> jane.doe at someotherdomain.org
> 
> Is there a standard way to normalize the addresses? It is only the second
> form that I am interested in. TIA,

from email.Utils import parseaddr

-Peter



More information about the Python-list mailing list