
#############################################
**Cassandane::TestEntity::DataType::Mailbox**
#############################################


****
NAME
****


Cassandane::TestEntity::DataType::Mailbox - the Mailbox entity datatype


***************
FACTORY METHODS
***************


inbox
=====



.. code-block:: perl

     my $mailbox = $user->mailboxes->inbox;


This acts like \ ``->get``\ , returning a mailbox instance, but finds and
returns the mailbox with the inbox role.



****************
INSTANCE METHODS
****************


new_email
=========



.. code-block:: perl

     my $email = $mailbox->new_email({ ... });


This creates a new email (currently by calling \ ``Email/import``\ , although this
may change) and returns an Email instance object.

Valid arguments to include in the passed hashref are:


.. code-block:: perl

     to      - the string to use as the To header
     from    - the string to use as the From header
     subject - the string to use as the Subject header
     message_id - the string to use in the Message-Id header; include <...>!
 
     headers - a reference to an array in the form [ name, value, n2, v2, ... ]
 
     body_str  - the body, as a text string (not a byte string)
     body_type - the media type of the body (default: text/plain)
     body_encoding - the C-T-E of the body (default: quoted-printable)



