Solved

imap php

Posted on 2012-03-09
4
383 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
Comment Utility
Try wrapping your host with "{}".

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

Author Comment

by:PhillO
Comment Utility
StingRaY

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

Accepted Solution

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

Author Comment

by:PhillO
Comment Utility
StingRaY

Your dead right!!! thanks
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now