Bug 567

Summary: Send email unsuccessfully
Product: New-Territories-Cycle-Track-Navigation-System Reporter: lst <sitongliu9-c>
Component: SendEmailAssignee: lst <sitongliu9-c>
Status: RESOLVED FIXED    
Severity: normal CC: ruiruyang2-c
Priority: High    
Version: 1.0   
Hardware: PC   
OS: Windows   
Attachments: Error msg screen capture 1
Error msg screen capture 2

Description lst 2021-11-16 21:31:08 HKT
Steps to reproduce:

Step 1: Run the program directly.

Expected result: The email is sent. 
Actual result: Error 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 59sm2548082pjz.34 - gsmtp

------------------------------
	at com.sun.mail.smtp.SMTPTransport$Authenticator.authenticate(SMTPTransport.java:965)
	at com.sun.mail.smtp.SMTPTransport.authenticate(SMTPTransport.java:876)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:780)
	at javax.mail.Service.connect(Service.java:366)
	at javax.mail.Service.connect(Service.java:246)
	at javax.mail.Service.connect(Service.java:267)
	at javax.mail.Transport.send0(Transport.java:252)
	at javax.mail.Transport.send(Transport.java:174)
	at SmartNavigationSystem.SendEmail.sendEmail(SendEmail.java:31)
	at SmartNavigationSystem.JsonOperation.sendEmailToAllMembers(JsonOperation.java:355)
	at SmartNavigationSystem.Schedule.sendEmail(Schedule.java:21)
	at SmartNavigationSystem.Main.main(Main.java:11)
Comment 1 lst 2021-11-16 21:33:02 HKT
Solution:

The configuration of the system email account should be set as below:

Sign in and follow this link: https://myaccount.google.com/lesssecureapps
Change "Allow less secure apps: OFF" to "Allow less secure apps: ON"
Comment 2 lst 2021-11-25 17:26:20 HKT
Created attachment 96 [details]
Error msg screen capture 1
Comment 3 lst 2021-11-25 17:26:46 HKT
Created attachment 97 [details]
Error msg screen capture 2