使用环境:
开发JavaMail中遇到
报错内容:
javax.mail.AuthenticationFailedException: Login fail. Password is incorrect or service is not open. More information at: https://service.mail.qq.com/cgi-bin/help?id=28
2023-05-06 09:54:14.891 30946-31675/com.cinfotech.my W/System.err: at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:727)
2023-05-06 09:54:14.891 30946-31675/com.cinfotech.my W/System.err: at javax.mail.Service.connect(Service.java:388)
2023-05-06 09:54:14.892 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.email.CheckingMails.getStoreIMAP(CheckingMails.java:95)
2023-05-06 09:54:14.892 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.email.QueryEmail.queryNewEmail(QueryEmail.java:143)
2023-05-06 09:54:14.893 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.net.email.EmailRequest.queryNewEmail(EmailRequest.java:197)
2023-05-06 09:54:14.893 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.util.GetEmailService.queryEmail(GetEmailService.java:249)
2023-05-06 09:54:14.893 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.util.GetEmailService.toQueryEmail(GetEmailService.java:206)
2023-05-06 09:54:14.893 30946-31675/com.cinfotech.my W/System.err: at com.cinfotech.my.util.GetEmailService$4.run(GetEmailService.java:188)
2023-05-06 09:54:14.894 30946-31675/com.cinfotech.my W/System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
2023-05-06 09:54:14.894 30946-31675/com.cinfotech.my W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2023-05-06 09:54:14.894 30946-31675/com.cinfotech.my W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
2023-05-06 09:54:14.895 30946-31675/com.cinfotech.my W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
2023-05-06 09:54:14.896 30946-31675/com.cinfotech.my W/System.err: at java.lang.Thread.run(Thread.java:920)
2023-05-06 09:54:14.898 30946-31675/com.cinfotech.my E/QueryEmail: ===================>[QueryEmail.queryNewEmail() (QueryEmail.java:194)]查询新邮件异常-->Login fail. Password is incorrect or service is not open. More information at: https://service.mail.qq.com/cgi-bin/help?id=28
解决方法:
根据报错代码提示Login fail. Password is incorrect or service is not open.
意思是登录失败,密码不正确或者服务未建立链接
额,这里的报错好明显,就告诉问题在哪
1 密码不正确
2 服务未建立链接
我这里就是密码的问题