Link to home
Start Free TrialLog in
Avatar of nfundo
nfundo

asked on

how to get unread emails from outlook to an intranet (php)

Our company is using intranet (based on php) for internal needs. They are requesting to have there a notification each time a new message (email) is coming. We use Outlook for email and server is Exchange
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Hello nfundo,

Which Exchange version ?

Regards.
Avatar of nfundo
nfundo

ASKER

exchange 2003
Avatar of nfundo

ASKER

by mistake
>They are requesting to have there a notification each time a new message (email) is coming

Which type of notification ? An email ?
Avatar of nfundo

ASKER

Hello,

a pop up message or on updating of a page counter
Happy new year!

You need two PHP page.
A page to check email which will be called by Ajax in the second page

The first :

Line 2, you need to replace IMAP server, username and password of course

<?php
    $imap = imap_open("{mail.server.local:143}INBOX", "username@domain.local", "password");
    $message_count = imap_num_msg($imap);
    print $message_count;
    imap_close($imap);
?>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nfundo

ASKER

none
Thanks for the points!