PDA

View Full Version : PHP imap_open problem


Cowboy_X
09-17-2002, 04:21 PM
I'm having some trouble using the imap_open function in a webmail app I'm writing for OS X.

I've set up the mail server according to the directions in this Macdevcenter (http://www.macdevcenter.com/pub/a/mac/2002/08/23/jaguar_server.html?page=3), and I'm pretty positive that the mail server is set up right as I have no trouble retrieving mail with "mail.app".

However, my PHP function isn't able to connect to the mail server. Here is the line in question:
$link=imap_open("{127.0.0.1:993/imap}INBOX",$username,$password);
Querying the page with this code sends the system into a never-ending seek.

I can replace the parameters with information regarding my ISP's mail server and it will work fine. I've also tried appending /imap with /ssl/novalidate-cert , but that just errors out completely.

any ideas?

driverdave
09-18-2002, 12:27 AM
It's a shot in the dark, but replace the IP with localhost

OR

with the real IP of your machine, not the local loopback.

I've seen odd errors using 127.0.01/localhost sometimes, although I haven't done any mail stuff with PHP on OSX.

Cowboy_X
09-18-2002, 01:00 AM
Tried both, I'm afraid. And also some bogus IPs and made-up server names, which error our instantly. So I know it's checking the IP for something...

oeholmen
09-20-2002, 03:18 AM
I have the same problems you describe and have followed the same MacDev article. I know that my server works because other clients connect without a problem (Mail.app and others). But on windows with Outlook 6, I get an error when connencting, saying that there is a problem with one of the certs. This might be just an Outlook problem, but maybe it is something more? That could explain why the page is loading forever. It is waiting for an authentication that doesn'nt come.

I would really like to see a solution to this!

vibin
03-01-2006, 04:37 AM
I cannot use imap_open () to connect mail server. Please help me.
With this PHP code I cannot show an email overview and display emails from POP3 accounts.

$conn = imap_open ("{mail. myserver.com:110/pop3/notls}INBOX", “myusername”, “mypassword”) or die ("Connection fail" .imap_last_error ());

if ($conn)
{
echo "Success";
}
else
{
echo "Fail ";
}

If i gave wrong username & password, the result will be “connection fail and check for account “.

When I was giving correct details I get error

“page cannot be displayed with Cannot find server or DNS Error Internet Explorer “

vibin
03-02-2006, 12:50 AM
I cannot use imap_open () to connect mail server.
Please help me.
With this PHP code I cannot show an email overview and display emails from POP3 accounts.

$conn = imap_open ("{mail. myserver.com:110/pop3/notls}INBOX", “myusername”, “mypassword”) or die ("Connection fail" .imap_last_error ());

if ($conn)
{
echo "Success";
}
else
{
echo "Fail ";
}

If i gave wrong username & password, the result will be “connection fail and check for account “.

When I was giving correct details I get error

“page cannot be displayed with Cannot find server or DNS Error Internet Explorer “