Google拒绝OAuth 2 Javax.凭据错误的邮件API



java.lang.RuntimeException: javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/?p=BadCredentials v7-20020a4a8607000000b0041bdf977c6dsm58061ooh.31 - gsmtp

我在尝试使用javax时收到此错误。邮件API发送电子邮件通过我的GMail帐户。我试图检查我的设置,以验证它是否允许不太安全的应用程序使用我的GMail帐户,但谷歌网站显示

To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

有谁知道我在哪里可以找到一个关于如何建立钩子来发送/接收邮件消息与我的GMail帐户,绕过这些新要求的当前指南?

  1. 进入页面与您的Gmail/Google帐户->https://myaccount.google.com/security
  2. 在sign In to Google部分,启用2-Step Verification
  3. 启用两步验证后,返回Signing in to Google部分
  4. 点击App密码
  5. 选择app作为邮件选择设备作为其他-选择一个名称
  6. 完成了!复制密码并与用户名帐户
  7. 一起使用

最新更新