<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Get information about the current mailbox</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imap-mail.html">imap_mail</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imap-mime-header-decode.html">imap_mime_header_decode</a></div> <div class="up"><a href="ref.imap.html">IMAP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="function.imap-mailboxmsginfo" class="refentry"> <div class="refnamediv"> <h1 class="refname">imap_mailboxmsginfo</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">imap_mailboxmsginfo</span> — <span class="dc-title">Get information about the current mailbox</span></p> </div> <div class="refsect1 description" id="refsect1-function.imap-mailboxmsginfo-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">object</span> <span class="methodname"><strong>imap_mailboxmsginfo</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$imap_stream</code></span> )</div> <p class="para rdfs-comment"> Checks the current mailbox status on the server. It is similar to <span class="function"><a href="function.imap-status.html" class="function">imap_status()</a></span>, but will additionally sum up the size of all messages in the mailbox, which will take some additional time to execute. </p> </div> <div class="refsect1 parameters" id="refsect1-function.imap-mailboxmsginfo-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter"> imap_stream</code></em></span><dd> <p class="para">An IMAP stream returned by <span class="function"><a href="function.imap-open.html" class="function">imap_open()</a></span>.</p></dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.imap-mailboxmsginfo-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the information in an object with following properties: <table class="doctable table"> <caption><strong>Mailbox properties</strong></caption> <tbody class="tbody"> <tr> <td>Date</td> <td>date of last change (current datetime)</td> </tr> <tr> <td>Driver</td> <td>driver</td> </tr> <tr> <td>Mailbox</td> <td>name of the mailbox</td> </tr> <tr> <td>Nmsgs</td> <td>number of messages</td> </tr> <tr> <td>Recent</td> <td>number of recent messages</td> </tr> <tr> <td>Unread</td> <td>number of unread messages</td> </tr> <tr> <td>Deleted</td> <td>number of deleted messages</td> </tr> <tr> <td>Size</td> <td>mailbox size</td> </tr> </tbody> </table> </p> <p class="para"> Returns <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 examples" id="refsect1-function.imap-mailboxmsginfo-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-3365"> <p><strong>Example #1 <span class="function"><strong>imap_mailboxmsginfo()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br />$mbox </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}INBOX"</span><span style="color: #007700">, </span><span style="color: #DD0000">"username"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">)<br /> or die(</span><span style="color: #DD0000">"can't connect: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$check </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_mailboxmsginfo</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /><br />if (</span><span style="color: #0000BB">$check</span><span style="color: #007700">) {<br /> echo </span><span style="color: #DD0000">"Date: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Date </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Driver: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Driver </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Mailbox: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Mailbox </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Messages: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Nmsgs </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Recent: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Recent </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Unread: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Unread </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Deleted: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Deleted </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br /> echo </span><span style="color: #DD0000">"Size: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$check</span><span style="color: #007700">-></span><span style="color: #0000BB">Size </span><span style="color: #007700">. </span><span style="color: #DD0000">"<br />\n" </span><span style="color: #007700">;<br />} else {<br /> echo </span><span style="color: #DD0000">"imap_check() failed: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">() . </span><span style="color: #DD0000">"<br />\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.imap-mail.html">imap_mail</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.imap-mime-header-decode.html">imap_mime_header_decode</a></div> <div class="up"><a href="ref.imap.html">IMAP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>