javax.mail.AuthenticationFailedException:[AUTH]需要Web登录 [英] javax.mail.AuthenticationFailedException: [AUTH] Web login required

查看:110
本文介绍了javax.mail.AuthenticationFailedException:[AUTH]需要Web登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Java构建一个应用程序来阅读电子邮件.而且过去几天没有任何错误.但是今天突然出现了这样的错误.

I build an application using Java to read emails. And It worked without any errors past days. But suddenly today came up an error like this.

javax.mail.AuthenticationFailedException: [AUTH] Web login required: https://support.google.com/mail/answer/78754
        at com.sun.mail.pop3.POP3Store.protocolConnect(POP3Store.java:207)
        at javax.mail.Service.connect(Service.java:295)
        at javax.mail.Service.connect(Service.java:176)
        at MailReader.readMail(MailReader.java:44)
        at MailReader.run(MailReader.java:32)
        at java.util.TimerThread.mainLoop(Unknown Source)
        at java.util.TimerThread.run(Unknown Source)

我不知道如何解决此问题.我没有进行2向身份验证.而且我还放了安全性较差的应用程序.所以我不知道出什么问题了.有人可以帮助我吗?我非常感谢.

I can't figure out how to fix this. I didn't put 2-way authentication. And also I put less secure app allowed. So I can't figure out what is wrong. Anybody can help me? I greatly appreciate that.

这是我正在使用的代码,

Here is the code I am using,

String host = "pop.gmail.com";
String username = "somename@gmail.com";
String password = "password";

Properties prop = new Properties();
Session session = Session.getInstance(prop, null);
Store store = session.getStore("pop3s");
store.connect(host, username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_WRITE);

推荐答案

该错误是由于Google的错误所致,导致POP3服务无法正常工作.2天后修复.

The error was due to an error at Google, which caused POP3 services to work incorrectly. It was fixed after 2 days.

仅在论坛帖子中找不到官方声明.相关资料: 1 2

Could not find official statement, only forum posts. Related sources: 1, 2, 3

这篇关于javax.mail.AuthenticationFailedException:[AUTH]需要Web登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆