WebMail Lite 7 documentation

Mail

API reference on CApiMailManager class

Mail manager is responsible for accessing information on IMAP server - getting message list, downloading particular messages, handling messages in various ways. It allows for manipulating flags, deleting or creating folders, etc.

The manager is invoked in a standard way:

<?php
include_once '/var/www/webmail/libraries/afterlogic/api.php';
if (class_exists('CApi') && CApi::IsValid()) {
    $oApiMailManager = CApi::Manager('mail');
    ...
} else {
    echo 'WebMail API isn\'t available';
}

See more on using this manager in Getting number of all or unread mails and Getting new or last messages examples.

NOTE: unlike other classes, methods of this manager do not indicate operation success by returning boolean values. If the operation is unsuccessful, exception will be thrown; typically, \CApiInvalidArgumentException is used for this purpose.

API reference on CApiMailManager class