# 3. `VirtualMailManager.EmailAddress` — Handling of e-mail addresses

This module provides the `EmailAddress` class to handle validated e-mail addresses.

## 3.1. EmailAddress

class VirtualMailManager.EmailAddress.EmailAddress(address)

  Creates a new EmailAddress instance.

  Parameters:

    address (`basestring`) – string representation of an e-mail addresses

  Raises:

    - VirtualMailManager.errors.EmailAddressError – if the address is syntactically wrong.

    - VirtualMailManager.errors.VMMError – if the validation of the local-part or domain name fails.

  An EmailAddress instance has the both read-only attributes:

  localpart

    The local-part of the address local-part@domain

  domainname

    The domain part of the address local-part@domain

## 3.2. Examples

    >>> 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
    >>>