使用 imap 获取 Gmail 收件箱
我从这里获得了下载 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
将您的主机名更改为此主机名,然后尝试
仔细检查用户名和密码
change you host name to this one and try
and double check the username and password
打开
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...
您可以在我的网站下载我的 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.
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
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