java javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39417636/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 04:21:10  来源:igfitidea点击:

javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/continue?sarp=1

javaauthentication

提问by user6814715

I get the following message when trying to send email from an application. Though I have the mail.jaradded for my project, it still gives me the same error. Please help.

尝试从应用程序发送电子邮件时收到以下消息。虽然我mail.jar为我的项目添加了,但它仍然给我同样的错误。请帮忙。

javax.mail.AuthenticationFailedException: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754s8sm1528084ots.38 - gsmtp

at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823) at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756) at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:673) at javax.mail.Service.connect(Service.java:295) at javax.mail.Service.connect(Service.java:176) at augCloud.SendEmailDemo$2.actionPerformed(SendEmailDemo.java:92) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$300(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

javax.mail.AuthenticationFailedException: 534-5.7.14 请通过您的 Web 浏览器和 534-5.7.14 登录,然后重试。534-5.7.14 了解详情,请访问 534 5.7.14 https://support.google.com/mail/answer/78754s8sm1528084ots.38 - gsmtp

在 com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:823) 在 com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:756) 在 com.sun.mail.smtp.SMTPTransport .protocolConnect(SMTPTransport.java:673) at javax.mail.Service.connect(Service.java:295) at javax.mail.Service.connect(Service.java:176) at augCloud.SendEmailDemo$2.actionPerformed(SendEmailDemo.java) :92) 在 javax.swing.AbstractButton.fireActionPerformed(Unknown Source) 在 javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) 在 javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) 在 javax.swing.DefaultButtonModel.setPressed(未知来源)在 javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知来源)在 java.awt.Component。processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl( Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) ) 在 java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue。access$300(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain $1.doIntersectionPrivilege(Unknown Source) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.awt.EventQueue$4.run(Unknown Source) at java.security .AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt。 EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread。pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)

回答by Beck Yang

Acoording to Security and privacy. Google may block sign-in attempts from some apps that do not use modern security standards, such as OAuth 2.0.

根据安全和隐私。Google 可能会阻止来自某些不使用现代安全标准(例如 OAuth 2.0)的应用程序的登录尝试。

For javamail, the solution prevent this error is :

对于javamail,防止此错误的解决方案是:

  1. Go to the "Less secure apps" section in Google Account.
  2. Next to "Access for less secure apps," select Turn on.
  1. 转到Google 帐户中的“安全性较低的应用”部分。
  2. 在“访问不太安全的应用程序”旁边,选择打开。

回答by Sagor Chowdhuri

Follow these steps:

跟着这些步骤:

  1. Go to Google accountby clicking your profile picture in the top-right corner
  2. Go to Sign-in and Security_ tab
  3. Scroll down the page and check the less secure apps: OFF button
  1. Google account单击右上角的个人资料图片转到
  2. Sign-in and Security_ tab
  3. 向下滚动页面并检查 less secure apps: OFF button