javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted

前端 未结 10 1325
臣服心动
臣服心动 2020-12-03 07:33

I am getting this error when I try to send mail using the JavaMail API:

javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accept         


        
相关标签:
10条回答
  • 2020-12-03 08:07

    This worked for me:

    1. Login to the gmail account you are sending mail from
    2. Go to Manage your Google Account -> Security -> Less secure app access -> Turn on access (not recommended)
      or
      Access the URL:
      https://www.google.com/settings/security/lesssecureapps
    3. Turn "Allow less secure apps: OFF" to "Allow less secure apps: ON"
    0 讨论(0)
  • 2020-12-03 08:10

    I have the same error but when I run the app from the terminal, it goes away. My email configuration is provided:

    spring.mail.host=smtp.googlemail.com
    spring.mail.username=weddingcard9999@gmail.com
    spring.mail.password=Weddingcard.1
    spring.mail.port=587
    spring.mail.properties.mail.smtp.starttls.enable=true
    spring.mail.properties.mail.smtp.auth=true
    spring.mail.properties.mail.smtp.starttls.required=true
    
    0 讨论(0)
  • 2020-12-03 08:11

    It works for me, you must configure your Gmail account with the below steps:

    In the security section:

    You need to Change "Allow less secure apps: OFF" to "Allow less secure apps: ON"

    0 讨论(0)
  • 2020-12-03 08:12

    Log on gmail account, in Account ->

    click Security -> turn off 2-step verification and turn on "Less secure app access"

    May be because of things above, hope help you

    0 讨论(0)
提交回复
热议问题