Solve error javax.mail.AuthenticationFailedException

后端 未结 15 1183
太阳男子
太阳男子 2020-11-29 05:45

I\'m not familiar with this function to send mail in java. I\'m getting an error while sending email to reset a password. Hope you can give me a solution.

Below is m

15条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 06:36

    There are a few steps you have to keep in mind.

    • First, make sure you have turned off 2-way authentication of google account
    • Second, allow access for less secure apps- https://myaccount.google.com/lesssecureapps

    Now there are two scenarios If you are developing it in your local machine login to your google account in your browser, this way the google recognizes the machine.

    If you have deployed the application onto a server then after the first request you will get an authentication error, so you have to give access to the server, just go here to give access- https://www.google.com/accounts/DisplayUnlockCaptcha

提交回复
热议问题