Link to home
Start Free TrialLog in
Avatar of PhillO
PhillOFlag for Australia

asked on

imap php

Am trying to connect to my fedora 14 64bit imap server using php the code is below.

However, I am getting the following error and don't know where to start to solve it
"Can't open mailbox localhost:143INBOX: no such mailbox "
Any Ideas?

<?php
$host = 'localhost:143';
$user = 'user';
$password = 'password';
$mailbox = "{$host}INBOX";

$mbox = imap_open($mailbox , $user , $password);
$str = imap_errors();  echo("imap_errors():\n");  print_r($str);

if (imap_ping($mbox)){ print "success";}
else                 { print "fail"; }

imap_close($mbox);

?>

Open in new window

Avatar of StingRaY
StingRaY
Flag of Thailand image

Try wrapping your host with "{}".

$host = '{localhost:143}';
Avatar of PhillO

ASKER

StingRaY

Thanks for responding but if you look on Line 5 it is
ASKER CERTIFIED SOLUTION
Avatar of StingRaY
StingRaY
Flag of Thailand 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 PhillO

ASKER

StingRaY

Your dead right!!! thanks