To use imap you must start your imap session using the imap_open() it is best to do this in a Variable so you dont leav an pen session.
$mailbox = imap_open ("{localhost:110/pop3}INBOX", "user", "pass");
we now have a Stream to a pop3 server running on localhost(The host of the script).
What if we want to read the stream.
Reading an IMAP stream is fairly simple as long as you know the basic pre-defined variables for doing so.
Why dont we check for some new email?
Ok then define a variable i will call $checker you name it what you want. Add the following code to your variable
$checker = imap_check($mailbox);
Notice our mailbox has cropped up again the imap_check function will check using other variables linked to this.
For example
Total Number of Messages : <?= $checker->Nmsgs ?> Name of Mailbox : <?= $checker->mailbox ?>Note that this is 100% Correct Syntax
Those are 2 basic examples of how to check the mailserver Here are a list of all the different Variable Types for imap_check()
Date :: Get the Date of last received message Driver :: Show the Connection Type Mailbox :: Display Mailbox Name Nmsgs :: Total Messages Recent :: Number of recent messages
Well this is the Basic IMAP check Function of PHP I will soon post a tutorial for IMAP headers also.
Thanks for reading,
Affix