Don't you hate it when you are at a friend's house or visiting relatives and you want to check your email but dont know your POP/IMAP settings. Or even worse, they dont have your POP or IMAP software?
Web based email seems to be the talk of the Net lately. Heres how to use PHP to make a quick, simple and effective IMAP or POP mail reader. Once this is done, you can now be able to read your email from anywhere in the world with only a web browser.
The first necessity is to make sure that you have an available IMAP server. you can get the UW imap server and libraries from ftp://ftp.cac.washington.edu/imap/ (you will need the libraries to compile into php anyway, so you might as well install the IMAP server that comes with it also)
Once you have a running IMAP server and PHP compiled with IMAP support (make sure you read the PHP docs on how to compile PHP with imap), the rest is easy!
We'll make a nice and simple 3-script based mail reader.
The first script will be to read in your IMAP username and password. We will use the standard PHP authentication for that.
It opens up an IMAP connection to the mailserver specified by $MAILSERVER, passing in your username and password.
It then get a list of all the messgae headers and in a loop, prints them all out. Besides printing them out, it also makes each one a link to view.php3, passing it that message number.