revjim.net

read my Inbox

Some time ago I offered a feature on my site that allowed readers to see the contents of my Inbox. As time went on that feature went away. But now it’s back. Enjoy! For now, it’s real time. If it gets too much traffic, I’ll start caching the output every 15 minutes or so.

For the curious, it’s only 5 lines of code (not counting the HTML generating portions):

$imap = imap_open(
        $imapcfg['mailbox'],
        $imapcfg['username'],
        $imapcfg['password'],
        OP_READONLY
);
$boxinfo = imap_check($imap);
for($i = $boxinfo->Nmsgs; $i >= 1; $i--) {
        $msg[] = imap_headerinfo($imap,$i);
}

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>