Page 1 of 1

Trying to get imap_open to work ...

Posted: Wed Mar 10, 2010 12:24 pm
by ScottMartin
I am trying to connect to our POP3 server from my code. I get an error using the following code:

Code: Select all

 
$mbox = imap_open ("{mail.mydomain.com:110/pop3}INBOX", $user, $pass);
 
or
 
$mbox = imap_open ("{mail.mydomain.com/pop3:110}INBOX", $user, $pass);
$mbox = imap_open ("{mail.mydomain.com/pop3:110/notls}INBOX", $user, $pass);
 
print_r(imap_errors());
 
ERROR: No such host as mail.mydomain.com

I can telnet into the server:

Code: Select all

 
telnet mail.mydomain.com 110
USER user
PASS pass
LIST
 
I can connect with fsockopen:

Code: Select all

 
$sd = fsockopen($host, 110, $errno, $errstr, 2.0);
 
it returns:

Code: Select all

 
sd: Resource id #45
errno: 0
errstr: 
 
What am I overlooking:

Regards,
Scott.