首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP imap_open() =>

PHP imap_open() =>
EN

Stack Overflow用户
提问于 2014-07-17 12:34:10
回答 1查看 11.5K关注 0票数 3

我试图设置到邮件服务器的IMAP连接,问题是它在消息中失败:

代码语言:javascript
复制
array(4) {
  [0]=> string(81) "Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed."
  [1]=> string(81) "Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed."
  [2]=> string(82) "Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed."
  [3]=> string(49) "[CLOSED] IMAP connection broken (server response)"
}

我用来打开连接的代码是:

代码语言:javascript
复制
$mbox = imap_open('{server.test.com:993/imap/ssl}INBOX', 'user@test.com', 'password');

我对我的Gmail帐户进行了相同的语法测试,它运行得很好。我可以连接到server.test.com,也可以使用雷鸟(IMAP -SSL-993)进行身份验证,所以它并不是真正有问题的邮件服务器。

我已经在Stack溢出中搜索过这个问题,但是我还没有解决它,下面是我迄今为止尝试过的所有解决方案:

  1. $mbox = imap_open('{server.test.com:993/imap/ssl}INBOX', 'user@test.com', 'password', null, 1, array('DISABLE_AUTHENTICATOR' => 'PLAIN'));
  2. $mbox = imap_open('{server.test.com:995/pop3/ssl}INBOX', 'user@test.com', 'password');
  3. $mbox = imap_open('{server.test.com:993/imap/ssl/novalidate-cert}INBOX', 'user@test.com', 'password'); (The cert is valid)
  4. $mbox = imap_open('{server.test.com:993/pop3/ssl/novalidate-cert}INBOX', 'user@test.com', 'password'); (The cert is valid)
  5. $mbox = imap_open('{server.test.com:993/imap}INBOX', 'user@test.com', 'password');
  6. $mbox = imap_open('{server.test.com:993/pop3}INBOX', 'user@test.com', 'password');
  7. $mbox = imap_open('{server.test.com:993}INBOX', 'user@test.com', 'password');

知道问题是从哪里来的吗?我还将发布上述所有解决方案的所有错误消息,以及稍后的邮件服务器和php日志。

注意:要表示我使用的错误:

代码语言:javascript
复制
var_dump(imap_errors());
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-08-03 12:04:15

由于web服务器和邮件服务器运行在同一服务器上,所以我设法连接到服务器IP地址:

代码语言:javascript
复制
$mbox = imap_open('{127.0.0.1:993/imap/ssl/novalidate-cert}INBOX', 'user@test.com', 'password');
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24803739

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档