473,909 Members | 4,189 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.mydomai n.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.c om, 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.c om and it works fine.
I can RETR messages etc. The port is definately 110, the username is
definately us**@mydomain.c om.

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 20016
qc******@gmail. com wrote:
>
I have tried the basic syntax...
$mbox = imap_open ("{mail.mydomai n.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.co m: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.mydomai n.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("{mai l.mydomain.com: 110/pop3}INBOX",
"us**@mydomain. com", "password") ;

print_r(imap_er rors());

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.n lwrote 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.mydomai n.com:110/pop3}INBOX",
"us**@mydomai n.com", "password") ;

Warning: imap_open() [function.imap-open]: Couldn't open stream
{mail.mydomai n.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("{mai l.mydomain.com: 110/pop3}INBOX", "us**@mydomain. com",
"password") ;

print_r(imap_er rors());

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
8348
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 "<p><h1>Mailboxes</h1>\n";
0
915
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 mailbox and perform imap_uid and imap_msg without entering user's password? Thanks Jaysheel
2
2106
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, OP_ANONYMOUS); and it's failing to connect.
0
2324
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 connect using secure connection such as imap_open ("{10.0.0.0:993/imap/tls}INBOX", "user", "pass") or imap_open ("{10.0.0.0:993/imap/ssl}INBOX", "user", "pass"). When I use MSOutlook, it connects without problem using ssl. Any ideas?
0
1753
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 if(!imap_open("{MailServerDomain:143/imap/notls}INBOX","username","password")) echo "error is ".imap_last_error()."\n"; else echo "successful";
2
3490
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 connection string, but it seems to be ignored. The call to imap_open() currently looks something like this: imap_open("{cyrus.google.com}/tls/novalidate-cert/norsh/service=imap/user=cadm", "cadm", "secret", OP_HALFOPEN); As I said, it works....
0
1590
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 = imap_open("{mailserver:995/pop3/notls/ssl/novalidate-cert}", $username, $password, OP_HALFOPEN);
0
1599
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, this code seems to work on some pop3 servers... on some servers, if($stream) evaluates to false and imap_error prints "Can not authenticate to POP3 server: POP3 connection broken in response" However i'm pretty sure authentication works, because...
1
2814
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 PHP imap_open (which works with POP mailboxes) function. I have tried various methods for the values of the domain, but nothing seems to work. Has anyone successfully done this? Thanks,
0
10035
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10919
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9725
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5938
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6138
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.