0

I'm integrating PHP webmail read functionality in php. I already tried using IMAP functions. But it could not connect.So I just ask you is there any possibility to get messages from webamil with out using IMAP function.

Below is my IMAP Code. Can you check the code also give me suggestions for why doesn't work. I'm looking forward for your valuable reply.

$emailAddress = 'info@example.com'; // Full email address
$emailPassword = 'xxxxxxxx';        // Email password
$domainURL = 'example.com';         // Your websites domain
$useHTTPS = false;                      

/* BEGIN MESSAGE COUNT CODE */

$inbox = imap_open('{'.$domainURL.':143/notls}INBOX',$emailAddress,$emailPassword) or die('Cannot connect to domain:' . imap_last_error());
$oResult = imap_search($inbox, 'UNSEEN');

if(empty($oResult))
    $nMsgCount = 0;
else
    $nMsgCount = count($oResult);

imap_close($inbox);

echo('<p>You have '.$nMsgCount.' unread messages.</p>');

Thanks in advance

suresh
  • 180
  • 11
  • Please provide the errors you get. It may simply be a firewall issue, you may not be running an IMAP server on port 143, .... – Max Jun 03 '15 at 14:38
  • possible duplicate of [how to get inbox messages from CPanel Webmail using PHP IMAP functions](http://stackoverflow.com/questions/30617992/how-to-get-inbox-messages-from-cpanel-webmail-using-php-imap-functions) – Max Jun 03 '15 at 14:40
  • This is also pretty much an exact duplicate of your other question. – Max Jun 03 '15 at 14:40
  • @Max i found this error occur Cannot connect to domain:Can't connect to example.com,143: Unknown error (10013) Notice: Unknown: Can't connect to example.com,143: Unknown error (10013) (errflg=2) in Unknown on line 0 – suresh Jun 04 '15 at 03:49
  • Have you actually checked that an IMAP server is running? And if it is, if it's running on that port? – Max Jun 04 '15 at 16:17

0 Answers0