Cannot get Send Email to work with GMail

Hi dear KNIMErs,

I don’t understand why I can’t get Gmail to work with the Send Email Node.

I basically followed nearly every advice here on the forums setting up an App password for KNIME (because I have 2FA enables since years).

However, I always seem to have connection problems, anyone knows, why?

These are the error messages I receive:
ERROR Send Email 4:18 Execute failed: Error while communicating with the smtp server: 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
ERROR Send Email 4:18 Execute failed: Error while communicating with the smtp server: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
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
ERROR Send Email 4:18 Execute failed: Exception reading response, try adjusting the smtp timeout settings
ERROR Send Email 4:18 Execute failed: Couldn’t connect to host, port: smtp.gmail.com, 1025; timeout 2000, try adjusting the smtp timeout settings
ERROR Send Email 4:18 Execute failed: Error while communicating with the smtp server: com.sun.mail.smtp.SMTPSendFailedException: 530-5.7.0 Must issue a STARTTLS command first. Please visit
530-5.7.0 About SMTP error messages - Google Workspace Admin Help and review RFC 3207
530 5.7.0 specifications for more information. n13-20020a05600c500d00b004083996dad8sm5166182wmr.18 - gsmtp

I tried all kinds of combinations of ports and connection security, nothing works.

Thanks in advance.

Hi,
PKIX path building failed usually indicates an error with the SSL certificates. However, Google most definitely uses certificates signed by a well-known certificate authority that is already included in Java, so I think that is not it. You can add the line

-Djavax.net.debug=all

to your knime.ini and this adds debug output about all SSL connections to the standard output of the KNIME process. You may find some pointers there, but beware, it is quite a lot of stuff to wade through.
It could also be that there is a proxy between your computer and the Google server, presenting you with a different certificate. When it happens, this usually happens in company networks. Here you’d need to add a root certificate for the proxy to your Java keystore. How to do that is described here under “Client setup”.
Kind regards,
Alexander

1 Like

Thank you for your response @AlexanderFillbrunn ,

I must admit, I took the lazy route. Instead of sending this through Gmail I am now using my own mail server (for my own domain) and that works perfectly fine.

Maybe for anyone in the future who is reading this and does not have access to a mail server, I also used mailhog to great success, which is an open source executable that basically runs a mail server locally on your machine.

Again: thank you!

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.