使用 imap 获取 Gmail 收件箱

发布于 2024-10-08 21:41:32 字数 654 浏览 0 评论 0原文

我从这里获得了下载 gmail 收件箱的代码: http://davidwalsh.name/gmail-php-imap

use these 2 hostnames 
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
{imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox

但出现此错误。

 Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox in /home/medicalh/public_html/testmail.php on line 9
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com,993: Connection timed out

我在 stackoverflow 上搜索过,但没有找到解决方案,

谢谢

i got a code from here to download gmail inbox:
http://davidwalsh.name/gmail-php-imap

use these 2 hostnames 
$hostname = '{imap.gmail.com:993/imap/ssl}INBOX';
{imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox

but getting this error.

 Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert/norsh}Inbox in /home/medicalh/public_html/testmail.php on line 9
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com,993: Connection timed out

i have searched on stackoverflow but did't got solution

thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

香草可樂 2024-10-15 21:41:32

将您的主机名更改为此主机名,然后尝试

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

仔细检查用户名和密码

change you host name to this one and try

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

and double check the username and password

伴梦长久 2024-10-15 21:41:32

打开 php.ini 文件并删除 ;extension=php_imap.dll 之前的 ;
并重新启动您的服务器。

你的代码会工作...

Open the php.ini file and remove ; before ;extension=php_imap.dll
and restart your server.

Your code will work...

梦里兽 2024-10-15 21:41:32

您可以在我的网站下载我的 Gmail 课程: 。我还提供了一个测试文件供您测试类文件。

如果不起作用,我相信这可能是您的服务器的问题。您应该联系您的系统管理员。

You can download my Gmail class at my website: . I have also included a test file for you to test the class file.

If it does not work, I believe it could be your server's problem. You should contact your system administrator.

半﹌身腐败 2024-10-15 21:41:32

gmail IMAP SSL 身份验证的问题之一与 Google 帐户安全有关。一旦出现登录错误,请退出所有 Google 帐户。然后,访问此链接:
https://accounts.google.com/DisplayUnlockCaptcha

在此处输入图像描述
使用您尝试通过 imap 访问的帐户登录。

按照以下步骤操作,您就可以使用 php imap 登录 gmail。

它在这里直观地显示:
http://jeffreifman.com /filtered-open-source-imap-mail-filtering-software-for-php/configuring-gmail/

来源:http://php.net/manual/en/function.imap-open.php

One of the issues with gmail IMAP SSL authentication is related to Google's account security.Once you get the login error once, sign out of all your google accounts. Then, visit this link:
https://accounts.google.com/DisplayUnlockCaptcha

enter image description here
Log in with the account you're attempting to access via imap.

Follow the steps and you'll then be able to login in to gmail with php imap.

It's visually shown here:
http://jeffreifman.com/filtered-open-source-imap-mail-filtering-software-for-php/configuring-gmail/

source: http://php.net/manual/en/function.imap-open.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文