gpt4 book ai didi

java - Outlook javamail 错误 "A3 BAD User is authenticated but not connected"

转载 作者:行者123 更新时间:2023-12-04 13:59:10 34 4
gpt4 key购买 nike

我尝试在我的电子邮件中打开文件夹,但没有运气。

这是错误:

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();
}
}

这是 Prop :
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);

可能是什么问题?

tnx 很多

最佳答案

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

关于java - Outlook javamail 错误 "A3 BAD User is authenticated but not connected",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55022078/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com