PHP Manual
Prev |  | Next

# imap_get_quota

(PHP 4 >= 4.0.5)

imap_get_quota -- Retrieve the quota level settings, and usage statics per mailbox

## Description

``array imap_get_quota` (int imap_stream, string quota_root)`

Returns an array with integer values limit and usage for the given mailbox. The value of limit represents the total amount of space allowed for this mailbox. The usage value represents the mailboxes current level of capacity. Will return `FALSE` in the case of failure.

This function is currently only available to users of the c-client2000 library.

`imap_stream` should be the value returned from an imap_status() call. This stream is required to be opened as the mail admin user for the quota function to work. `quota_root` should normally be in the form of user.name where name is the mailbox you wish to retrieve information about.

Example 1. imap_get_quota() example
    $mbox = imap_open("{your.imap.host}","mailadmin","password",OP_HALFOPEN)
          or die("can't connect: ".imap_last_error());

    $quota_value = imap_get_quota($mbox, "user.kalowsky");
    if(is_array($quota_value)) {
        print "Usage level is: " . $quota_value['usage'];
        print "Limit level is: " . $quota_value['limit'];
    }

    imap_close($mbox);

See also imap_open(), imap_set_quota().

Prev | Home | Next
imap_fetchstructure | Up | imap_getmailboxes