This module provides the EmailAddress class to handle validated e-mail addresses.
Creates a new EmailAddress instance.
Parameters: | address (basestring) – string representation of an e-mail addresses |
---|---|
Raises: |
|
An EmailAddress instance has the both read-only attributes:
The local-part of the address local-part@domain
The domain part of the address local-part@domain
>>> from VirtualMailManager.EmailAddress import EmailAddress
>>> john = EmailAddress('john.doe@example.com')
>>> john.localpart
'john.doe'
>>> john.domainname
'example.com'
>>> jane = EmailAddress('jane.doe@example.com')
>>> jane != john
True
>>> EmailAddress('info@xn--pypal-4ve.tld') == EmailAddress(u'info@pаypal.tld')
True
>>> jane
EmailAddress('jane.doe@example.com')
>>> print john
john.doe@example.com
>>>