【发布时间】:2021-03-27 03:17:54
【问题描述】:
我正在使用 imap 库在 codeigniter 框架中工作。我想将所有邮件从我的邮件服务器获取到我的网络应用程序中。 我的代码在我使用时工作正常
imap_open("{imap.gmail.com:993/imap/ssl}INBOX", my_email, my_password);
但每当我尝试访问我的 hostgator 邮件服务器时,我都会遇到这些类型的错误。
1: imap_open(): Couldn't open stream {mail.mydomain.com:993/imap/ssl}INBOX
2: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1).
3: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. (errflg=2)
【问题讨论】:
-
好像你的认证失败了:/
-
是的,但是这段代码在我的 gmail 帐户上运行良好,当我尝试使用 hostgaotr 邮件服务器时出现上述错误
-
使用您的 gmail 帐户有一个工作 imap_open 是一回事,但是使用一个工作 imap 客户端(因为它与您的 gmail 帐户一起工作),针对 hostgaotr (?) 服务器,这实际上是说,您的身份验证失败是另一回事。
标签: php email imaplib codeigniter-4