['STORAGE']['usage'] and ['STORAGE']['limit'] are values in KB (1024 Bytes)
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
imap_get_quotaroot — Lee los cuotas de cada usuario
Recupera los cuotas de cada usuario. El valor límite representa el espacio límite asignado para este usuario para el uso de su buzón de correo. El valor de uso representa el tamaño actual del buzón de correo.
imap
An IMAP\Connection instance.
mailbox
mailbox
debe ser un nombre de buzón de correo
(i.e. INBOX).
Devuelve un array de enteros, conteniendo los cuotas del buzón de correo del usuario. Todos los valores son representados por una clave basada en el nombre del buzón, y por un array representando el nivel de uso y los límites.
Esta función devolverá false
si ocurre un error, y
un array de datos si la respuesta del servidor no pudo ser comprendida.
Versión | Descripción |
---|---|
8.1.0 |
The imap parameter expects an IMAP\Connection
instance now; previously, a valid imap recurso was expected.
|
Ejemplo #1 Ejemplo con imap_get_quotaroot()
<?php
$mbox = imap_open("{imap.example.org}", "kalowsky", "password", OP_HALFOPEN)
or die("Conexión imposible : " . imap_last_error());
$quota = imap_get_quotaroot($mbox, "INBOX");
if (is_array($quota)) {
$storage = $quota['STORAGE'];
echo "STORAGE nivel de uso : " . $storage['usage'];
echo "STORAGE tamaño límite : " . $storage['limit'];
$message = $quota['MESSAGE'];
echo "MESSAGE nivel de uso : " . $message['usage'];
echo "MESSAGE tamaño límite : " . $message['limit'];
/* ... */
}
imap_close($mbox);
?>
Esta función es accesible únicamente a los usuarios de la biblioteca c-client2000 o más reciente.
imap
debería ser abierto como el usuario
cuyo buzón de correo se desea verificar.
['STORAGE']['usage'] and ['STORAGE']['limit'] are values in KB (1024 Bytes)
just to make a note for all the people that are wondering the differences between $quota['STORAGE'] and $quot['MESSAGE']
the $quot['STORAGE'] is the size of the mailbox in KB
but $quota['MESSAGE'] is actually the number of messages stored in the mailbox and the up limit of the total messages allowed