imap_open():无法打开流 [英] imap_open(): Couldn't open stream

查看:656
本文介绍了imap_open():无法打开流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用imap访问我的Gmail收件箱。我已经应用了几乎所有可用的解决方案,也可以在谷歌中使用。但我面临同样的问题。



以下是我的代码:

  $ hostname ={imap.gmail.com:993/imap/ssl/novalidate-cert}; 

$ mailbox = imap_open($ hostname,'my gmail account','my gmail password');

if($ mailbox)
{
echo'if';
}
else
{
echo'else';
}
exit;

当我将这段代码运行到本地系统时,它会给我一些这样的消息:警告:imap_open():无法在D中打开流{imap.gmail.com:993/imap/ssl/novalidate-cert} :\xampp\htdocs\php-imap-mailboxes\test-mail.php on line 4

else

注意:未知:[警告]请通过以下方式登录您的网络浏览器:第0行的未知的 https://support.google.com/mail/accounts/answer/78754 (失败)(errflg = 1)



注意:未知:[警告]请通过您的网络浏览器登录: https://support.google.com/mail/accounts/answer/78754 (失败)(errflg = 1)在第0行的未知中



注意:未知:[警告]请通过您的网络浏览器登录:<$第0行中未知的c $ c> https://support.google.com/mail/accounts/answer/78754 (失败)(errflg = 1)

>
注意:未知:太多登录f ailures(errflg = 2)in line 0


我将这个脚本运行到我的本地系统。请帮助我,因为我已经在这个问题上花了很多时间。



谢谢,
Ali

解决方案

确保你有 OpenSSL 已安装。



以下是有关Google群组的相关讨论。
https://groups.google.com/forum /#!topic/comp.lang.php/JB5hm8cKi_Q


I am trying to access my gmail inbox using imap. I have applied almost all the possible solutions available here and also in google. But i am facing the same issue.

Below is my code :

 $hostname = "{imap.gmail.com:993/imap/ssl/novalidate-cert}";

$mailbox = imap_open($hostname, 'my gmail account', 'my gmail password');

if ($mailbox) 
{
    echo 'if';
} 
else
    {
        echo 'else';
    }
    exit;

When i run this code in to my local system it will give me some message like this :

Warning: imap_open(): Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert} in D:\xampp\htdocs\php-imap-mailboxes\test-mail.php on line 4
else
Notice: Unknown: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure) (errflg=1) in Unknown on line 0

Notice: Unknown: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure) (errflg=1) in Unknown on line 0

Notice: Unknown: [ALERT] Please log in via your web browser: https://support.google.com/mail/accounts/answer/78754 (Failure) (errflg=1) in Unknown on line 0

Notice: Unknown: Too many login failures (errflg=2) in Unknown on line 0

I am running this script in to my local system. Please help me in to this as i have already spent lot's of time in this issue.

Thanks, Ali

解决方案

Make sure you have OpenSSL installed.

Here is a related discussion on google groups. https://groups.google.com/forum/#!topic/comp.lang.php/JB5hm8cKi_Q

这篇关于imap_open():无法打开流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆