I assume that you read the document that is linked with the Google Mail error message, and followed all the instructions given there? What have been the results?
Next, the support article you referenced is relevant for encrypted emails - do you use encryption?
If so, which Java version are you on?
The "Test Connection" does check only whether the SMTP MTA (the email host) can be reached; it will not attempt to login, neither it will try to send an email. Therefore the result you have seen for the connection test does not contradict your later observations: you are reaching the Google SMTP MTA and the respective error message was sent from it.
The instructions mentioned in gmail article are the configurations to be taken care at email account level and is indeed taken care. No configuration steps mentioned have yielded positive results. I attach a screenshot of the email account for reference.
We don't use any encryption. I can notice this error just with simple activity invoking "SendSimpleEmail". We are on Pega 8.2.1 and underlying java version should be the latest (i presume!)
Just curious about your point that test connection will not attempt to login - when i test connection using a junk password, the connection test failed. And the error message narrates that authentication is attempted. Attempt to login and authentication attempt are different? screenshot attached.
Another important point to highlight here:
We have two applications CRM and MKT. This gmail could send emails from MKT app context when offers and email campaigns are initiated. But same gmail account has problem from CRM app. context.