连接到Gmail IMAP PHP“无法打开流” [英] Connecting to Gmail IMAP PHP "Couldn't open stream"
问题描述
这是我的代码:
$ hostname ='{imap.gmail.com:995/imap/ssl/novalidate-cert}';
$ username ='emailaddress@gmail.com'; $ password ='password';
$ inbox = imap_open($ hostname,$ username,$ password)或die('无法连接到Gmail:'。imap_last_error());
print_r(imap_errors());
不会返回以外的任何错误:
警告:imap_open()[function.imap-open]:无法在$ b中打开流
{imap.gmail.com:995/imap/ssl/novalidate-cert} $ b /home/a8066360/public_html/test/imap.php on line 6
无法连接到Gmail:无法连接到gmail-imap.l.google。 com,995:
Connection timed out
我注意到如果我将单引号改为`
由于安全原因,shell_exec()已被禁用...
请帮助!!!
您需要port 993 ,SSL
端口995是SSL POP3 端口。
There are lots of people having similar issues but no one is answering their questions. I have IMAP enabled in PHP, Using all the correct information. I don't see where I'm going wrong.
Here's my code:
$hostname = '{imap.gmail.com:995/imap/ssl/novalidate-cert}';
$username = 'emailaddress@gmail.com'; $password = 'password';
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
print_r(imap_errors());
Not returning any errors other than:
Warning: imap_open() [function.imap-open]: Couldn't open stream {imap.gmail.com:995/imap/ssl/novalidate-cert} in /home/a8066360/public_html/test/imap.php on line 6
Cannot connect to Gmail: Can't connect to gmail-imap.l.google.com, 995: Connection timed out
I've noticed that if I change the single quotes to `
shell_exec() has been disabled for security reasons...
Please help!!!
You need port 993, the SSL IMAP port.
Port 995 is the SSL POP3 port.
这篇关于连接到Gmail IMAP PHP“无法打开流”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!