Page 1 of 1

Couldn't open stream

Posted: Tue Jul 08, 2003 2:08 am
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

Posted: Tue Jul 08, 2003 3:28 am
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

Posted: Tue Jul 08, 2003 5:17 am
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