Solved

imap php

Posted on 2012-03-09
4
402 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
  • 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 500 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
The viewer will learn how to dynamically set the form action using jQuery.

776 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