• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

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

0
PhillO
Asked:
PhillO
  • 2
  • 2
1 Solution
 
StingRaYCommented:
Try wrapping your host with "{}".

$host = '{localhost:143}';
0
 
PhillOAuthor Commented:
StingRaY

Thanks for responding but if you look on Line 5 it is
0
 
StingRaYCommented:
No. It's different. If you echo line 5, it will be "localhost:143INBOX" not "{localhost:143}INBOX".
0
 
PhillOAuthor Commented:
StingRaY

Your dead right!!! thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now