Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 7th, 2006, 01:25 PM
qccitchy@gmail.com
Guest
 
Posts: n/a
Default IMAP_OPEN problems

G'day,

I am so stuck I am pulling what's left of my hair out. Any gurus out
there that can help me with this would be greatly appreciated.

I am relatively new to php and am trying to connect to a pop 3 mail
server using imap_open.

I have read the manual and numerous website, tryed numerous classes,
been confused, lost my mind, gone back to basics and I am at wits end.

I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
"user@mydomain.com", "password");

and regardless of rearranging where I put the port number :110 and
/pop3, using INBOX or other variants or not at all, using user or
user@domain.com, adding /notls, adding /novalidate-cert, trying just
mydomain.com instead of mail.mydomain.com, adding user= before my user
name and many others I've forgotten over the last week ...

I just can't get it to work, with the constant error ....

Warning: imap_open() [function.imap-open]: Couldn't open stream
{mail.mydomain.com:110/pop3}

Now, I have tried telnet'ing to my mail.myserver.com and it works fine.
I can RETR messages etc. The port is definately 110, the username is
definately user@mydomain.com.

I am running php 5.1 build 2600 off a windows xp machine trying to
connect to what I believe is windows server. I've checked the email
account with mail programs and it works fine. I just can't connect in
php.

If anyone has any suggestions on how I can work out what is going on
with this thing it would be muchly appreciated.

  #2  
Old August 7th, 2006, 02:45 PM
Ruben van Engelenburg
Guest
 
Posts: n/a
Default Re: IMAP_OPEN problems

qccitchy@gmail.com wrote:
Quote:
>
I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
"user@mydomain.com", "password");
>
Warning: imap_open() [function.imap-open]: Couldn't open stream
{mail.mydomain.com:110/pop3}
You're saying you tried telnetting to the server with the same user
credentials and that it worked. However I've been trying to reproduce
this for you and the only way to reproduce your exact error is
specifying either the wrong username or password.
When I specify the right username and password everything works fine,
but as soon as I change either the username or the password into
something invalid I get the error:
Warning: imap_open() [function.imap-open]: Couldn't open stream
{my.mailhost.com:110/pop3}INBOX in pop.php on line 2
So I'd really check this once again if I were you.

Also you could try specifying the third parameter to imap_open setting
it to OP_DEBUG, if it's something else than the username or password it
should output debug messages.

HTH.
Ruben.
--
http://www.phpforums.nl
  #3  
Old August 7th, 2006, 03:15 PM
Ruben van Engelenburg
Guest
 
Posts: n/a
Default Re: IMAP_OPEN problems

Ruben van Engelenburg wrote:
Quote:
qccitchy@gmail.com wrote:
Quote:
>>
>I have tried the basic syntax...
>$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
>"user@mydomain.com", "password");
>>
>Warning: imap_open() [function.imap-open]: Couldn't open stream
>{mail.mydomain.com:110/pop3}

Oh and also another debugging suggestion. I noticed there's also a
function imap_errors() which returns an array of imap errors that
occured during the pageview. If you do something like this:

$res = imap_open("{mail.mydomain.com:110/pop3}INBOX",
"user@mydomain.com", "password");

print_r(imap_errors());

You'll see if it actually was an authentication problem or something else.

HTH.
Ruben.
--
http://www.phpforums.nl
  #4  
Old August 7th, 2006, 11:15 PM
Joe
Guest
 
Posts: n/a
Default Re: IMAP_OPEN problems


"Ruben van Engelenburg" <ruben@NOSPAM.nlwrote in message
news:44d74cc4$0$4525$e4fe514c@news.xs4all.nl...
Quote:
Ruben van Engelenburg wrote:
Quote:
>qccitchy@gmail.com wrote:
Quote:
>>>
>>I have tried the basic syntax...
>>$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
>>"user@mydomain.com", "password");
>>>
>>Warning: imap_open() [function.imap-open]: Couldn't open stream
>>{mail.mydomain.com:110/pop3}
>
>
Oh and also another debugging suggestion. I noticed there's also a
function imap_errors() which returns an array of imap errors that occured
during the pageview. If you do something like this:
>
$res = imap_open("{mail.mydomain.com:110/pop3}INBOX", "user@mydomain.com",
"password");
>
print_r(imap_errors());
>
You'll see if it actually was an authentication problem or something else.
>
HTH.
Ruben.
--
http://www.phpforums.nl
Thanks for help Ruben. Very much appreciated.

I actually know now that my syntax for the imap_open function is ok.
I get the feeling it is my firewall/s. I can telnet my mail server from my
work machine (XP) and its ok, but it doesn't appear to be working from my
apach server machine (XP Pro). Says its connected and just sits there even
though I've disabled the machines firewall. Probably not for this group now,
but I'll keep working on it.

Thanks again.


  #5  
Old August 8th, 2006, 08:25 AM
Ruben van Engelenburg
Guest
 
Posts: n/a
Default Re: IMAP_OPEN problems

Joe wrote:
Quote:
I actually know now that my syntax for the imap_open function is ok.
I get the feeling it is my firewall/s. I can telnet my mail server from my
work machine (XP) and its ok, but it doesn't appear to be working from my
apach server machine (XP Pro). Says its connected and just sits there even
though I've disabled the machines firewall. Probably not for this group now,
but I'll keep working on it.
Hi Joe,

Yes if imap_errors() doesn't return an error it's definitely a
network/security problem. Anyway I hope you'll figure it out, good luck!

Ruben.

--
http://www.phpforums.nl
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles