用javaMail使用gmail发送邮件,报错:AuthenticationFailedException:534-5.7.14

报错信息

Exception in thread "main" javax.mail.AuthenticationFailedException: 534-5.7.14 .google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbv_
534-5.7.14 wFq1HGtjxdpBxMmd2EiT7LW1S_7xx_6UrmYzRine_w7g0CgxP-zXJhssTANrZndfSVU5rN
534-5.7.14 PKEVO8_RzOwxhM20V51-EBffrEGyEK6hOL6pylQUzU4jmMH6AvuYm846Agir_idEqL8I8U
534-5.7.14 PNzf8OWUok1uvH1fFaiI1ZjuNQM6EBI__LPBFZYH3RNeMUDY_vRuWZVqhyKhZo_hY22GJw
534-5.7.14 b4D6xieOJmbcTzGaNZiZmxR1P7SCU> 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 m15sm2855398iod.85 - gsmtp

    at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:950)
    at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:861)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:766)
    at javax.mail.Service.connect(Service.java:366)
    at javax.mail.Service.connect(Service.java:246)
    at javax.mail.Service.connect(Service.java:267)
    at com.mxh1995.pro.mail.MailTest.main(MailTest.java:76)

进入:https://www.google.com/settings/security/lesssecureapps
用javaMail使用gmail发送邮件,报错:AuthenticationFailedException:534-5.7.14_第1张图片
停用状态下,用gmail发送邮件就会那样,启用就能解决了。

你可能感兴趣的:(java)