Mail setup not working properly

Hello,

When I enter my email credentials and try to send test mail, I always get this message

“Unable to send email to following server: :25. Please check configuration on your email server. Refer to this guide for more details.”

The main problem is that I have set my port to 45 for non encryption SMTP. I have also tried changing to 465 for encryption SMTP but I still get the error message saying it cant connect to server at port 25.

Why is that happening?

Best regards

Mail Server Settings.jpg

Hello David,

Here is screenshot of my configuration. I can assure you that credentials and addresses are correct, and are provided by cPanel. Note how I have put port 465, but after trying to send test email error message mentions port 25.

testmail.png

I received errors referring to Port 25 when the SMTP Server/Port settings were incorrect or when the Email/Password was incorrect for the SMTP Server/Port…

Try this: If you have a GMail account, use the settings in my post for the Server and Port, and your GMail address and password. Also, you need to click this link
( https://myaccount.google.com/security ), and log in with your GMail credentials in order to set “Apps with account access” - “Allow less secure apps:” to “ON”…

Then we will know that there are no issues with your PC/network’s firewall…

1 Like

Hi there,

Can you please show me Katalon Studio logs in this case? Please refer to announcement discussion about this

@David I tried with gmail as you suggested and I got the same error. Here is the screenshot of my configs with my private gmail account

gmailsmtp.png

Hi Vinh, I could not find any mentions where to find logs for katalon studio. I found this on myself. I hope this is what you are looking for. Every time I click “Send test email” button I get only this exception

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-22 08:54:20.113

!MESSAGE

!STACK 0

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:25

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)

at org.apache.commons.mail.Email.send(Email.java:1448)

at com.kms.katalon.execution.util.MailUtil.sendTestMail(MailUtil.java:74)

at com.kms.katalon.composer.execution.settings.MailSettingsPage$11.run(MailSettingsPage.java:390)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25, response: 421

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1270)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

at javax.mail.Service.connect(Service.java:297)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at javax.mail.Transport.send0(Transport.java:168)

at javax.mail.Transport.send(Transport.java:98)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)

… 4 more

Ismar,

Did you click this link
( https://myaccount.google.com/security ), and log in with your GMail credentials in order to set the attribute “Apps with account access” - “Allow less secure apps:” to a value of “ON”.?

1 Like

I did David, unfortunately it still doesn’t work and produces the same error message. I have also tried disabling my antivirus and firewall but that was of no help either.

Best regards

Which Operating System is the Katalon Studio v5.4.1 application running on?

Windows, Linux, macOS, other?

Try to “Ping” the GMail SMTP Server to ensure that your network path is clear…

At a command prompt, type ping smtp.gmail.com

Microsoft Windows [Version 6.1.7601]

Copyright © 2009 Microsoft Corporation. All rights reserved.

C:\Users\dkedmondson>ping smtp.gmail.com

Pinging gmail-smtp-msa.l.google.com [2607:f8b0:400e:c03::6d] with 32 bytes of data:

Reply from 2607:f8b0:400e:c03::6d: time=50ms

Reply from 2607:f8b0:400e:c03::6d: time=47ms

Reply from 2607:f8b0:400e:c03::6d: time=54ms

Reply from 2607:f8b0:400e:c03::6d: time=48ms

Ping statistics for 2607:f8b0:400e:c03::6d:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 47ms, Maximum = 54ms, Average = 49ms

C:\Users\dkedmondson>

Hello David,

Sorry for the late response.

Katalon studio is running on Windows 10 pro (64 bit).

I can ping GMail SMTP server, here is the log:

Pinging gmail-smtp-msa.l.google.com [74.125.206.108] with 32 bytes of data:

Reply from 74.125.206.108: bytes=32 time=36ms TTL=39

Reply from 74.125.206.108: bytes=32 time=36ms TTL=39

Reply from 74.125.206.108: bytes=32 time=35ms TTL=39

Reply from 74.125.206.108: bytes=32 time=36ms TTL=39

Ping statistics for 74.125.206.108:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 35ms, Maximum = 36ms, Average = 35ms

Ismar,

Please attach your Katalon Studio log to this thread…

Here is my Katalon Studio log

.log

Google “sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”

It appears that your JVM has a certificate issue with the GMAIL Server…

I have installed smtp.gmail.com certificate to “path_to_katalon_instalation\Katalon_Studio_Windows_64-5.4.1\jre\lib\security\cacerts” using keytool. I no more get sun.security.validator.ValidatorException but I still get “org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:25

I have also installed certificate to my jvm but no luck either

Here is my log now

v2.log

You still have issues with the certificate…

Tue May 29 10:19:30 CEST 2018

{“traits”:{“host_name”:“Home-PC”,“os”:“win32”,“os_type”:“64”,“kat_version”:“5.4.1 build 1”,“kat_type”:“64”,“sessionId”:“7afa5bea-4cc4-4189-9d2c-2658a0d00b59”,“user_key”:“C37DAAA943A1C0B3F799CBCF803939EE”,“project”:3,“test_case”:27,“test_run”:74,“new_project”:0,“new_test_case”:0,“new_test_run”:0,“new_test_case_created”:0,“new_project_created”:0,“triggeredBy”:“openApplication”,“runningMode”:“gui”},“userId”:“ismar.turnic@una-sourcing.com”}

Warning: NLS unused message: Key in: com.kms.katalon.composer.webui.constants.composerWebuiMessages

Warning: NLS missing message: DIA_CONFIRM_INSTALL_WEBDRIVER in: com.kms.katalon.composer.webui.constants.composerWebuiMessages

Warning: NLS missing message: DIA_CONFIRM_INSTALL_WEBDRIVER_TITLE in: com.kms.katalon.composer.webui.constants.composerWebuiMessages

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-29 10:20:53.257

!MESSAGE

!STACK 0

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:25

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)

at org.apache.commons.mail.Email.send(Email.java:1448)

at com.kms.katalon.execution.util.MailUtil.sendTestMail(MailUtil.java:74)

at com.kms.katalon.composer.execution.settings.MailSettingsPage$11.run(MailSettingsPage.java:390)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25, response: 421

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1270)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

at javax.mail.Service.connect(Service.java:297)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at javax.mail.Transport.send0(Transport.java:168)

at javax.mail.Transport.send(Transport.java:98)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)

… 4 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-29 10:23:04.429

!MESSAGE

!STACK 0

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)

at org.apache.commons.mail.Email.send(Email.java:1448)

at com.kms.katalon.execution.util.MailUtil.sendTestMail(MailUtil.java:74)

at com.kms.katalon.composer.execution.settings.MailSettingsPage$11.run(MailSettingsPage.java:390)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

Caused by: javax.mail.MessagingException: Exception reading response;

** nested exception is:**

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

at javax.mail.Service.connect(Service.java:297)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at javax.mail.Transport.send0(Transport.java:168)

at javax.mail.Transport.send(Transport.java:98)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)

… 4 more

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)

at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)

at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)

at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)

at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)

at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)

at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)

at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:928)

at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)

at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)

at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)

at java.io.BufferedInputStream.read(BufferedInputStream.java:265)

at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)

at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)

… 12 more

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)

at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)

at sun.security.validator.Validator.validate(Validator.java:260)

at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)

at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)

at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)

at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)

… 24 more

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)

at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)

at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)

at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)

… 30 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-05-29 10:23:07.065

!MESSAGE

!STACK 0

org.apache.commons.mail.EmailException: Sending the email to the following server failed : smtp.gmail.com:465

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1421)

at org.apache.commons.mail.Email.send(Email.java:1448)

at com.kms.katalon.execution.util.MailUtil.sendTestMail(MailUtil.java:74)

at com.kms.katalon.composer.execution.settings.MailSettingsPage$11.run(MailSettingsPage.java:390)

at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

Caused by: javax.mail.MessagingException: Exception reading response;

** nested exception is:**

javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1462)

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1260)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)

at javax.mail.Service.connect(Service.java:297)

at javax.mail.Service.connect(Service.java:156)

at javax.mail.Service.connect(Service.java:105)

at javax.mail.Transport.send0(Transport.java:168)

at javax.mail.Transport.send(Transport.java:98)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)

… 4 more

Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)

at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)

at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)

at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)

at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)

at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)

at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)

at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)

at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)

at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)

at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:928)

at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)

at com.sun.mail.util.TraceInputStream.read(TraceInputStream.java:97)

at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)

at java.io.BufferedInputStream.read(BufferedInputStream.java:265)

at com.sun.mail.util.LineInputStream.readLine(LineInputStream.java:75)

at com.sun.mail.smtp.SMTPTransport.readServerResponse(SMTPTransport.java:1440)

… 12 more

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)

at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)

at sun.security.validator.Validator.validate(Validator.java:260)

at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)

at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)

at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)

at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)

… 24 more

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)

at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)

at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)

at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)

… 30 more

I have just double checked the keystore, and the certificate is there.
I have tried SSLPoke with my jvm and it works, BUT when I try SSLPoke with jvm that comes with katalon studio I get the “**sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification.”
** I have tried re adding the certificate but I got this message “keytool error: java.lang.Exception: Certificate not imported, alias <smtp.gmail.com> already exists”. Is katalon studio’s jre using \jre\lib\security\cacerts that is inside Katalon studio instalation folder or is it using some other keystore?

I have just updated to Katalon Studio 5.4.2 and I still have this problem. I have also tried to send an Email to my SMTP server without SSL/TSL but even that is not working.

Any advice?

[SOLVED]
Finally :slight_smile: Found out what was the problem. It was indeed problem with the certificates. When getting a certificate via openssl, my antivirus changed the certificate. So the fix was to turn off the antivirus when getting a certificate and when running Katalon, so it doesn’t change the certificate.

Thank you David for all your help.

Best regards
Ismar

1 Like

Ismar said:

[SOLVED]
Finally :slight_smile: Found out what was the problem. It was indeed problem with the certificates. When getting a certificate via openssl, my antivirus changed the certificate. So the fix was to turn off the antivirus when getting a certificate and when running Katalon, so it doesn’t change the certificate.

Thank you David for all your help.

Best regards
Ismar

hi,Ismar

I have the same problem as you .I finished reading this discussion post. And I turn off the antivirus when getting a certificate and when running Katalon,but I still have this problem.

Could you tell me the detailed solution to this problem?

Best regards

thank you