PHP imap_open失败,但OpenSSL的连接

问题描述:

我试着通过imap_openPHP imap_open失败,但OpenSSL的连接

imap_open('{mail.domain.com:995/pop3/tls}INBOX', 
    '[email protected]', 
    'password'); 

连接到POP3服务器,但我得到这些错误:

Warning: imap_open(): Couldn't open stream {mail.domain.com:995/pop3/tls}INBOX 
Fatal error: Maximum execution time of 30 seconds exceeded 
Notice: Unknown: POP3 connection broken in response (errflg=2) 

(按顺序,这是奇怪的注意是致命错误后)

在终端中运行此命令工作正常:

> openssl s_client -crlf -connect mail.domain.com:995 

+OK The Microsoft Exchange POP3 service is ready. 
USER [email protected] 
+OK 
PASS password 
+OK User successfully logged on. 

我已经尝试了各种其他开关,如/novalidate-cert,/debug,OP_DEBUG但获得相同的结果。

任何想法?

即使服务器指定TLS,在PHP中使用SSL连接。

imap_open('{mail.domain.com:995/pop3/ssl}INBOX', 
    '[email protected]om', 
    'password'); 
+0

谢谢!朋友 – 2014-12-24 02:45:12

+0

如果我使用imtp而不是pop3如何使用imap_open? – tyan 2015-12-10 10:06:45