Mail setup not working properly

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-09-27 17:01:51.006

!MESSAGE

!STACK 0

org.apache.commons.mail.EmailException: Sending the email to the following server failed : mail.midea.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:418)

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

Hello @7362-Monster

Well I had the problem where jre that comes with katalon studio didn’t have certificate installed. So here are the steps that fixed my problem. Please not that I will not post how to do every step since it will take too long. You can google how to do every step, it should not be too complicated.

1. Disabled my antivirus
2. Allowed inbound and outbound mail ports on windows firewall (ports 465 and 25) *
3. Fetched the ssl certificate of mail server, using openssl
4. Imported certificate into keystore using keytool **
5. I Allowed less secure apps on my google account ***
6. Your email should work now
7. You should turn on your antivirus back on when you finish, or decide to create an exception for Katalon studio

IMPORTANT NOTES:
* - 465 and 25 are common used ports for email but it does’t have to be true in every case. Please check ports on your mail server.
** - You have to import them into the keystore of the JRE that Katalon studio is using. So you should import it into KatalonInstalationFolder\jre\lib\security\cacerts
*** - Only required if using gmail account

I hope that this can help you in solving your problem

Best regards :slight_smile:
Ismar

1 Like

hi, @Ismar

I’m so sorry for the late reply.Thank you for your detailed guidance.

I solved my problem under your guidance. As you said,It was indeed problem with the certificates.

Thank you Ismar for all your help.

Best regards
Monster

1 Like

@7362-Monster

It was my pleasure :slight_smile:

Best regards
Ismar

For gmail, I tried the below steps, and it worked fine for me.
Firstly, close and reopen Katalon studio, followed by your project.
Then, provide the settings exactly as mentioned in the documentation.

(better to copy + paste)

Now, Try different protocols, i.e, select SSL protocol and click Send test email, if it work’s, fine, else, try with selecting TLS protocol.

1 Like

Hi guys, I have the same issue but for Outlook 2016. Outlook setting says to me that my account is Microsoft Exchange type. I find smtp using nslookup but it doesn’t work.
Does anybody of you using outlook with Katalon?

Hello!
I just want to confirm that problem still exists in
Version: 6.3.3
Build: 11
If you set the “Protocol” to “None”, email mechanism disregards the port number you set in “Port” field, and always tries to contact SMTP server on port 25.

I am trying to use free SMTP service, which uses non standard port (587), and thus can’t ever send an email.
It would be great if you solve that issue in one of upcoming updates.
Thank you!

As of 8/30/19, I am now unable to send emails over smtp.gmail.com; whether I set Port 25, 587, or 465; whether I set authentication to TLS, SSL, or None.
I also edited the “execution.properties” file inside the Project folder, to ensure Port #s were being updated as expected.
(Previous working settings were smtp.gmail.com, Port 25; authentication TLS.)

Is anyone aware of a recent policy change, either on Katalon’s or Gmail’s part?
Thank you!

i closed this as it is inactive