Can't send mails with GSuite Relay-SMTP

Hi,

I am trying to send mails with my GSuite Account using the Google Relay-SMTP. In the screenshot you can see my configuration. When I press the button “Test connection” I get the error message “Failed to send mail”. Can you see something that is obvious wrong?

Thanks for any help!

Greetings
Jan

Does the user have an email configured because Keycloak uses the currently logged in user to send a test email?

Yes, that was my first error, but it throws a different error message. I have fixed that issue.
Maybe I should add some more informations. I am using the docker container. I have setup the Relay-SMTP and allowed less secure apps in the google console.

EDIT: I had to activate 2 Factor and generate a seprrate app password. Thank you for your time!

If you have enabled keystore, then you need to add the Google CA certificate to that. I had the same issue and when i added the google CA, the email started working

keytool -import -alias google-ca -keystore truststore.jks -file googleca.cer

You can get the cer by typing gmail.com in your browser and then export the certifiate in base-64 format.

Hi Guys,
I´m not able to do this.
I´m using as base imagem: FROM jboss/keycloak:15.0.2
And i only get “keytool error: java.io.FileNotFoundException: truststore.jks (Permission denied)”