Couldn't open stream

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
navid
Forum Commoner
Posts: 68
Joined: Tue Sep 24, 2002 3:14 am
Location: iran

Couldn't open stream

Post by navid »

Hi ,
I have a error when i will do imap_open() a special mail server.

I have a php script , this is work on a unix host without problem.
this script connected to a lot of mail server by imap_open() function.

When transferred to the another unix web host ,this is have problem.
now, this script connect to the all of the mail servers without problem but this script conn't connect to special mail server on new web host.

i donn't know it.
please , help me to make correct it.
thanks,
bye
phpmitesh
Forum Newbie
Posts: 2
Joined: Mon Jul 07, 2003 6:53 am
Location: India
Contact:

Post by phpmitesh »

hello navid,
i have a also big problem.
i wrote one php script but it is not working.,
i got error " couldn't open stream localhost:143INBOX...
can u help me
my code is

<PRE>
<?php
$mbox = imap_open("{localhost:143}", "root", "testing");
if ($hdr == imap_check($mbox)) {
echo "Num Messages " . $hdr->Nmsgs;
}
else {
echo "failed";
}
?>
</pre>


thanks in advance
navid
Forum Commoner
Posts: 68
Joined: Tue Sep 24, 2002 3:14 am
Location: iran

Post by navid »

hello dear.
this is true script 4 you.

#################
<PRE>
<?php
$user="Your username mail ";
$pass="Your Password mail";
$mx_server="Your mail exchanger ";
if ($mbox = imap_open("{".$mx_server.":143}", $user, $pass))
{
$hdr = imap_check($mbox);
echo "Num Messages " . $hdr->Nmsgs;
}
else
{
echo "failed";
}
?>
</pre>

#################
i tested it.this is Ok.
if you test it and then this result is true 4 u ,please say to me.

nice to meet you.
navid
Post Reply