# Send email keycloak smtp, unable to find certificates

**URL:** <https://forum.keycloak.org/t/send-email-keycloak-smtp-unable-to-find-certificates/15757>\
**Category:** Configuring the server\
**Created:** [May 27, 2022, 10:24am UTC](https://forum.keycloak.org/t/send-email-keycloak-smtp-unable-to-find-certificates/15757 "2022-05-27T10:24:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreaCarella](https://avatars.discourse-cdn.com/v4/letter/a/f6c823/32.png) [@AndreaCarella](https://forum.keycloak.org/u/AndreaCarella)\
**Post date:** [May 27, 2022, 10:24am UTC](https://forum.keycloak.org/t/send-email-keycloak-smtp-unable-to-find-certificates/15757/1 "2022-05-27T10:24:01Z")

</div>

Hi,  
I have some problems to send email from keycloak. In the online form

 ![Schermata del 2022-05-27 12-16-53](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/5/5f560eabb7408241a663060457080df0ad4cb6e8.png)  
I set these value. The ip address I have set is the ip of a kubernetes service that expose port 443 and has the port 25 as target. The target kubernetes pod has a postfix configuration that is working fine. When I set starttls on, on the ui, I received:  
javax.mail.MessagingException: Could not convert socket to TLS;  
nested exception is:  
javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target  
I have added certificates to keystore with keytool -import -alias smtpApplication.telecomitalia.local -trustcacerts -cacerts -storepass changeit -file CA\_Root.cer -noprompt , is this the correct path?  
Otherwise if i set enable starttls on off I will receive:  
javax.mail.SendFailedException: Invalid Addresses;  
nested exception is:  
com.sun.mail.smtp.SMTPAddressFailedException: 454 4.7.1 [noreply-koreos@olivetti.com](mailto:noreply-koreos@olivetti.com): Relay access denied

Someone has some suggestion on how to solve, how to correctly configure keycloak?
