php imap 获取连接失败错误
Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/happy/public_html/source/imap/fet_mail_from_email_add.php on line 7
can't connect: Can't connect to gmail-imap.l.google.com,993: Connection timed out
我的片段是
$mbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX", "[电子邮件受保护]","somesecretpassword") 或死(“无法连接:”。imap_last_error());
Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl}INBOX in /home/happy/public_html/source/imap/fet_mail_from_email_add.php on line 7
can't connect: Can't connect to gmail-imap.l.google.com,993: Connection timed out
my snippet is
$mbox = imap_open("{imap.gmail.com:993/imap/ssl}INBOX",
"[email protected]","somesecretpassword")
or die("can't connect: " . imap_last_error());
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就像错误消息指出发生网络超时/连接失败一样。
确保任何网络设备(防火墙、带有 ACL 的路由器等)都不允许连接到 TCP 端口 993。
您可能会确保可以使用 ssh 从服务器连接到 Gmail 服务器,并首先尝试使用 telnet ,如果测试没问题,请尝试使用 PHP。
Like the error message point out there is a network timeout/connection failure happening.
Make sure any network equipment (Firewall, router with ACL, etc ...) don't disallow to connect to the TCP port 993.
You would probably make sure you can connect from the server to Gmail server using ssh and trying with telnet first, if that test is ok try with PHP.