【问题标题】:Unhandled Exception: SocketException: Failed host lookup: 'imap.gmail.com' (OS Error: No address associated with hostname, errno = 7)未处理的异常:SocketException:主机查找失败:'imap.gmail.com'(操作系统错误:没有与主机名关联的地址,errno = 7)
【发布时间】:2021-08-07 17:10:39
【问题描述】:

我在我的应用程序中使用了 imap_client 包来阅读我的邮件。 以下是我的连接代码:

`ImapClient client = new ImapClient();
    await client.connect("imap.gmail.com", 993, true);
    print("success");`

【问题讨论】:

  • 你在德国吗?否则,您有潜在的 DNS 问题。在某些国家/地区,您需要使用 imap.googlemail.com。
  • 试试我的答案here 你应该在 AndroidMenifest.xml 文件中添加 Internet 权限
  • genannt 中的 gamil.com 问题已在多年前得到解决。我记得钱易手了。

标签: flutter imap


【解决方案1】:

您似乎没有连接到互联网。或者您正在使用的服务器可能暂时关闭。主要是Socket Exception背后的原因。

【讨论】:

    猜你喜欢
    • 2021-08-31
    • 2021-04-19
    • 2020-11-29
    • 2019-09-28
    • 2023-03-26
    • 2019-07-12
    • 2021-05-09
    • 1970-01-01
    • 2020-05-10
    相关资源
    最近更新 更多