?
Solved

imap php

Posted on 2012-03-09
4
Medium Priority
?
422 Views
Last Modified: 2012-06-21
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
Comment
Question by:PhillO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 15

Expert Comment

by:StingRaY
ID: 37704223
Try wrapping your host with "{}".

$host = '{localhost:143}';
0
 

Author Comment

by:PhillO
ID: 37704289
StingRaY

Thanks for responding but if you look on Line 5 it is
0
 
LVL 15

Accepted Solution

by:
StingRaY earned 2000 total points
ID: 37704434
No. It's different. If you echo line 5, it will be "localhost:143INBOX" not "{localhost:143}INBOX".
0
 

Author Comment

by:PhillO
ID: 37704445
StingRaY

Your dead right!!! thanks
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question