Skip to content
Advertisement

javax.mail.AuthenticationFailedException: failed to connect during Transport.send(Message)

My code to send a mail via gmail was working fine 3 months back. But when I checked it again today, it is failing with below error. My gmail account is not 2 factor authenticated.

Code :

JavaScript

Error is :

JavaScript

Am I doing something wrong here? I have also checked other question, but its related to “failed to connect : no password provided”

=============================================================== Edit : Solution After trying debug mode ON as asked by @Nasten1988, I found the root cause of the issue and was able to proceed. Hence marking @Nasten1988 ‘s answer as the right answer.

Read my answer for the actual issue I had.

===============================================================

Advertisement

Answer

Failed to connect: maybe you connection is blocked by firewall, is your software up to date? No password provided: check the requirements from Google, they maybe changed them and check how your password is provided for your mail method. Maybe the debugger can help you. That’s what I would look for.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement