无法使用java mail API发送邮件,javax.mail.AuthenticationFailedException:534-5.7.14

时间:2016-10-23 18:05:45

标签: java servlets gmail javamail

我写了一个Web应用程序,它有一个模块向用户发送验证邮件,它的工作方式与我在localhost上的预期完全相同,但是当我在生产中部署时,我在日志上遇到了这个错误,它就是这样的。不在那里工作

javax.mail.AuthenticationFailedException: 534-5.7.14 <https://accounts.google.com/signin/conti                                                                                                  nue?sarp=1&scc=1&plt=AKgnsbts
534-5.7.14 PSxVIf7IrGYJnm7ivequonQKoxR9GDjeuOoXFc3t36lx9_OyD5i1sOFm5d2dnUyqMDwnX9
534-5.7.14 u0K1r9LV-tAdrgeAZRcWZ7AgQO96bGR2YeyseRAz09zH2OLSdMAgNI00gL7_DxJbDQlaNe
534-5.7.14 NE5TnmXGKt8Y1wKLXmo0ZpA0iXAfzC3rQqDGfrCirkAhPxnGs9ri-TC-Su3G_qObZMXgv4
534-5.7.14 U20bDgp1QDt5Qp7f59PkxoBnqcwxU> 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/78754 x1sm7003983pax.7 - 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:317)
        at javax.mail.Service.connect(Service.java:176)
        at javax.mail.Service.connect(Service.java:125)
        at javax.mail.Transport.send0(Transport.java:194)
        at javax.mail.Transport.send(Transport.java:124)
        at com.vivekNetwork.emailSender.EmailUtility.sendMail(EmailUtility.java:44)
        at com.vivekNetwork.emailSender.EmailController.doPost(EmailController.java:133)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterC                                                                                                  hain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.jav                                                                                                  a:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:5                                                                                                  02)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtoc                                                                                                  ol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

我试图解决这个问题,并阅读了一些文章https://stackoverflow.com/a/26741058,并实施了自己的身份验证器,但它们并不适合我,但我发现即使一切都很好,Google也不会让我从第三方申请。 如何禁用它以便我可以从我的Web应用程序发送邮件。

0 个答案:

没有答案