I have configured in Katalon Studio the mail-settings as described in the example/documentation and I can send a test email just fine.
Host: mailhub.harvard.edu Port: 587
Username: an allowed username that will be accepted by the mail host
Protocol: TLS
But when I execute my tests through the docker container (Docker ) I get the following message:
System is unable to email report. Reason: org.apache.commons.mail.EmailException: Sending the email to the following server failed : mailhub.harvard.edu: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.sendSummaryMail(MailUtil.java:136)
at com.kms.katalon.execution.launcher.ReportableLauncher.sendReportEmail(ReportableLauncher.java:173)
at com.kms.katalon.execution.launcher.ReportableLauncher.sendReport(ReportableLauncher.java:143)
at com.kms.katalon.execution.launcher.ReportableLauncher.preExecutionComplete(ReportableLauncher.java:82)
at com.kms.katalon.execution.launcher.ProcessLauncher.onWatchdogComplete(ProcessLauncher.java:191)
at com.kms.katalon.execution.launcher.LaunchWatchdog.notifyProcessTerminated(LaunchWatchdog.java:135)
at com.kms.katalon.execution.launcher.LaunchWatchdog.run(LaunchWatchdog.java:65)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.mail.MessagingException: 501 Syntax: HELO hostname
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1363)
at com.sun.mail.smtp.SMTPTransport.helo(SMTPTransport.java:838)
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:375)
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)
... 9 more
it looks like it is trying to use port 25. Again my config is set to the correct port and the Katalon Studio GUI sends a test email just fine.
When I call the docker container to execute added the following command to disable the bridging of the network (–net=host)
Hey Greg
Yep. It’s annoying. It seems sometimes 587 “takes” and others it just ignores it.
I gave up and used SendEmail downloaded from here: http://caspian.dotconf.net/menu/Software/SendEmail/
You can provide your initialization settings in a batch file and call the batch from Groovy.
My batch file looks something like…
c:\path-to-sendemail\sendemail -f me@somewhere.com -t other.person@somewhere.com me@somewhere.com -u %3 -s your.email.server.com:587 -xu user@somewhere.com -xp "password" -o tls=yes -o message-content-type=html -o message-file=%1 -a %2
%1, %2 and %3 are the report file name, screenshot file and subject line, etc.
that’s a great idea! I’ll add it to the growing list of thing to work on.
It is definitely something related directly to my machine and the docker network bridging. When I re-enabled the bridging the emailing worked fine.