473,224 Members | 1,292 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

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",
"us**@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
us**@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 us**@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.

Aug 7 '06 #1
4 19966
qc******@gmail.com wrote:
>
I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
"us**@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
Aug 7 '06 #2
Ruben van Engelenburg wrote:
qc******@gmail.com wrote:
>>
I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
"us**@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",
"us**@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
Aug 7 '06 #3
Joe

"Ruben van Engelenburg" <ru***@NOSPAM.nlwrote in message
news:44**********************@news.xs4all.nl...
Ruben van Engelenburg wrote:
>qc******@gmail.com wrote:
>>>
I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX",
"us**@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", "us**@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.
Aug 7 '06 #4
Joe wrote:
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
Aug 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: James Turnbull | last post by:
I am having troubles with some imap_open() I am using the following code: <?php $mbox = imap_open ("{mailserver:993/imap/ssl/no-validatecert}INBOX", "user", "password"); echo...
0
by: Jaysheel Mehd | last post by:
I will be running the script with imap_open() on the IMAP server as root. Can I run imap_open() without entering the password for a user. Is there any other way as an administrator, to open user's...
2
by: Rodney Pont | last post by:
I'm trying to use imap_open to get news from a server that requires a user name and password. I'm using $nntp = imap_open("{".$newsserver."/nntp:".$port."}".$newsgroup, $newsuser, $newspass,...
0
by: Dennis Biletsky | last post by:
Hi, I have a problem to connect mailbox using IMAP_OPEN. There is no problem to connect using standard port such as imap_open ("{10.0.0.0:143}INBOX", "user", "pass"), but I have a problem...
0
by: Hartt | last post by:
hi,all I have written a php scripts to test my mail server which built with Cyrus-imapd 2.2.3 OpenLDAP Postfix. <?php...
2
by: amiliv | last post by:
I'm attempting to connect to Cyrus IMAP server using imap_open() function. The connection is sucessfull, however there is a delay and warning message about "rsh failure". I added /norsh flag to...
0
by: oliversl | last post by:
Hi, I have a stock RHEL4 server and not that the imap_open() function no longer works. I have a local pop3 server running dovecot that I use to autenticate with this line: $imap_stream =...
0
by: R. Pelizzi | last post by:
hello, i'm getting a very strange behaviour with imap_open. My code does: $stream = imap_open("{{$_SESSION}:110/pop3}INBOX", $_SESSION, $_SESSION); then checks if that stream is valid... well,...
1
by: joshfeingold | last post by:
I have a CRM web application that checks users' email accounts and downloads them to the application. One of the users has a gmail account and I am trying to get access to this account using the...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.