I am having trouble sending an email from my gmail account with my java application.
I have written simple Java code to send emails from my application. I have MFA turned on and I have created an App Password and I am using it in my code. When I execute the code I get the message
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 ft13-20020a17090b0f8d00b0022630ba1c80sm1576429pjb.42 - gsmtp
I am fairly certain that the error message is not related to a code issue (but what do I know?) and I have double checked the credentials multiple times to ensure they are correct. I'm trying to understand what else could be the issue. I'd appreciate any advice or things to check.
Username and Password not accepted
Is the standard error message when you are trying to connect to Googles SMPT server and are trying to use the users actual google password.
As of May 30 2022 google has removed the less secure apps option. There is no way to turn this on as it no longer exists.
You have two options
Quick fix for SMTP username and password not accepted error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With