Jump to content

Recommended Posts

Posted

Does anyone know of a php script that will open an IMAP mailbox and echo the number of unread messages (You have X unread messages)?

 

I am trying to design a portal for our staff members, so they can see at a glance whether they have new email.

Posted

Hi,

 

According to the PHP website, this (in a nutshell) should work:

 

//check for new messages
$mailbox = imap_open("{localhost/pop3:110}INBOX","#username#","#password#");
// Check messages
$check = imap_check($mailbox);
print("Number of messages : " . $check->Nmsgs);

 

Failing that, you could try PHP Classes for a more complete class that will help with all aspects of IMAP interaction.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...