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

前端 未结 10 1428
臣服心动
臣服心动 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"

提交回复
热议问题