• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Sending email GMAIL account

 
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I am trying to send an email using Spring and Javamail. It doesn't recognize my Gmail credentials.




I get the error :




Could it be that the username should no be username@gmail.com?

Regards,
Angus
 
Ranch Hand
Posts: 92
1
 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Still using the whole email as username I get the same error.
 
Sheriff
Posts: 4899
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you been through the troubleshooting tips as suggested by Google? They helpfully gave you a link in the response error.

https://support.google.com/mail/?p=BadCredentials
 
Saloon Keeper
Posts: 6706
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also take note of the JavaMail FAQ entry about Gmail: https://javaee.github.io/javamail/FAQ#gmail
 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have you been through the troubleshooting tips as suggested by Google? They helpfully gave you a link in the response error.



It is only for windows app and I am developing a Linux open-source one.
 
Tim Moores
Saloon Keeper
Posts: 6706
161
Android Mac OS X Firefox Browser VI Editor Tomcat Server Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Angus Ferguson wrote:It is only for windows app and I am developing a Linux open-source one.


I just looked at that page, and there's nothing at all specifically about Windows in it (or any other OS, for that matter).
 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I just looked at that page, and there's nothing at all specifically about Windows in it (or any other OS, for that matter).



Google accounts don't give you the possibility to generate a 16 digit password associated with a Linux device.
 
Tim Cooke
Sheriff
Posts: 4899
318
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm totally confused too about the Windows comment.... all I see it information about authenticating to your Google account. I was thinking it might be something to do with 2-Step or not 2-Step verification
 
Marshal
Posts: 3258
487
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Angus Ferguson wrote:Could it be that the username should no be username@gmail.com?


username should be the full email address, not just the user-part.  For example: example@gmail.com
 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Username should be the full email address, not just the user-part.  For example: example@gmail.com



I am using the full email address as username the same error persists.
 
Rancher
Posts: 4740
50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the account you are accessing set up to allow less secure apps?
 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a new example from the internet.



The email here in the ranch is fake but the one I using is real. I am using Linux Centos in a VirtualCloud and my Tomcat is running in local.

I get the message "Sent message successfully...."

Any error at all...

 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have tried mailtrap to simulate a real SMTP behaviour and it sends the email correctly.

 
Angus Ferguson
Ranch Hand
Posts: 1402
3
Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well finally I just deleted the 2 step authentication method from my Gmail account and it worked correctly.
 
Lookout! Runaway whale! Hide behind this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic