+ Post New Thread
Results 1 to 3 of 3
Web Development Thread, PHP IMAP check mail script in Coding and Web Development; Does anyone know of a php script that will open an IMAP mailbox and echo the number of unread messages ...
  1. #1

    Join Date
    Dec 2006
    Location
    US
    Posts
    300
    Thank Post
    64
    Thanked 17 Times in 16 Posts
    Rep Power
    18

    PHP IMAP check mail script

    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.

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,400
    Thank Post
    636
    Thanked 961 Times in 661 Posts
    Blog Entries
    2
    Rep Power
    319

    Re: PHP IMAP check mail script

    Hi,

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

    Code:
    //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.

  3. #3

    Join Date
    Dec 2006
    Location
    US
    Posts
    300
    Thank Post
    64
    Thanked 17 Times in 16 Posts
    Rep Power
    18

    Re: PHP IMAP check mail script

    Works perfect!
    Thanks.

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 17
    Last Post: 19th March 2010, 11:51 PM
  2. Script Need to check disk space on remote servers
    By screwuphead in forum Scripts
    Replies: 8
    Last Post: 26th November 2007, 05:28 PM
  3. Setting up an IMAP server which collects POP mail
    By crc-ict in forum Wireless Networks
    Replies: 1
    Last Post: 17th March 2007, 05:31 PM
  4. Replies: 4
    Last Post: 25th December 2006, 09:15 PM
  5. VB Script ti check for folder and then copy contents to PC
    By tosca925 in forum How do you do....it?
    Replies: 4
    Last Post: 2nd October 2006, 08:15 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •