【问题标题】:Outlook javamail error "A3 BAD User is authenticated but not connected"Outlook javamail 错误“A3 BAD 用户已通过身份验证但未连接”
【发布时间】:2019-07-28 01:23:26
【问题描述】:

我尝试打开电子邮件中的文件夹,但没有成功。

这是错误:

Mar 06, 2019 1:24:14 PM Export run
SEVERE: A3 BAD User is authenticated but not connected.
javax.mail.MessagingException: A3 BAD User is authenticated but not connected.;
  nested exception is:
    com.sun.mail.iap.BadCommandException: A3 BAD User is authenticated but not connected.
    at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:960)
    at Export.getEmails(Export.java:115)
    at Export.run(Export.java:72)
    at Main.main(Main.java:5)
Caused by: com.sun.mail.iap.BadCommandException: A3 BAD User is authenticated but not connected.
    at com.sun.mail.iap.Protocol.handleResult(Protocol.java:338)
    at com.sun.mail.imap.protocol.IMAPProtocol.select(IMAPProtocol.java:656)
    at com.sun.mail.imap.IMAPFolder.open(IMAPFolder.java:926)
    ... 3 more

这就是我尝试过的:

public void getEmails() throws MessagingException, IOException {
    Session session = Session.getInstance(props);
    session.setDebug(DEBUG);

    store = null;
    store = session.getStore("imap");

    store.connect("imap-mail.outlook.com", this.userName, this.password);
    folder = store.getFolder(FOLDER_NAME);
    folder.open(Folder.READ_ONLY);
    int total_messages = folder.getMessageCount();
    if(total_messages > 0) {
        messages = folder.getMessages();
    }
}

这是道具:

props = new Properties();        
props.setProperty("mail.store.protocol", "imap");
props.setProperty("mail.imap.ssl.enable", "true");  
props.setProperty("mail.imap.starttls.enable", "true");    
props.setProperty("mail.imap.host", "imap-mail.outlook.com");
props.setProperty("mail.imap.port", "993");   

用户名和密码都可以。 我尝试更改密码,但在验证时出现另一个错误,因此密码和用户名是正确的。

我检查了 store.isConnected,我得到了真实的结果。 问题所在:

folder.open(Folder.READ_ONLY);

可能是什么问题?

很多

【问题讨论】:

  • 这很奇怪。看起来服务器出于某种原因不满意。您可能需要联系 outlook.com 支持以了解错误消息的含义。
  • 这个没有解释吗?
  • 你告诉我。当您与 outlook.com 支持人员联系时,他们说了什么?

标签: java outlook jakarta-mail


【解决方案1】:

我在使用 imap 和 outlook.office365.com 时遇到了这个错误。我尝试在 Outlook 中设置相同的帐户以确保它正常工作。虽然我能够添加帐户,但当我真正尝试查看收件箱时,Outlook 变得没有响应。因此,就我而言,一般来说这是帐户的问题,而不是我尝试连接的方式。我能够使用 pop3 成功进入收件箱,只是 imap 给了我一个问题。

【讨论】:

    【解决方案2】:

    我新创建的邮箱花了很长时间才在 O365 上注册其所有配置,至少对我来说这看起来像是时间问题,希望其他人觉得这有用。

    【讨论】:

      猜你喜欢
      • 2016-09-28
      • 2016-06-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-07
      • 1970-01-01
      • 2015-02-24
      • 1970-01-01
      相关资源
      最近更新 更多