# How to use the "send mail" node?

**URL:** <https://forum.knime.com/t/how-to-use-the-send-mail-node/75072>\
**Category:** KNIME Analytics Platform\
**Tags:** database\
**Created:** [November 8, 2023, 9:34am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072 "2023-11-08T09:34:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lee\_Po4](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/l/d9b06d/32.png) [@Lee\_Po4](https://forum.knime.com/u/Lee_Po4)\
**Post date:** [November 8, 2023, 9:34am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/1 "2023-11-08T09:34:48Z")

</div>

**Hi all,**

My “send mail” node cannot work. Is there any wrong about my setting?  
really confuse…

## Knime console shows the following info:

## _ERROR Send Email 4:5 Execute failed: Couldn’t connect to host, port: [smtp.gmail.com](http://smtp.gmail.com), 465; timeout 15000, try adjusting the smtp timeout settings_

## But when I adjust the smtp timeout settings, it’s showed…

## _ERROR Send Email 4:5 Execute failed: Couldn’t connect to host, port: [smtp.gmail.com](http://smtp.gmail.com), 465; timeout 15000, try adjusting the smtp timeout settings_

My setting for mail host (SMTP)  
SM TP Host: [smtp.gmail.com](http://smtp.gmail.com)  
SM TP Port: 587

---

<div class="post-metadata">

**Author:** ![lelloba](https://forum-cdn.knime.com/user_avatar/forum.knime.com/lelloba/32/43992_2.png) [@lelloba](https://forum.knime.com/u/lelloba)\
**Post date:** [November 8, 2023, 11:51am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/2 "2023-11-08T11:51:42Z")

</div>

Hello @Lee_Po4 ,

have a look at this:

> [@Sending Gmail using Send Email Node Configuration problem](https://forum.knime.com/t/sending-gmail-using-send-email-node-configuration-problem/36955):
>
> Hello Everyone, I have to send a mail using Gmail, for which I have used the Send Email node. What I have already done: Allowed Access in the Gmail account security settings Have tried the following configuration, using the answers in the forum So the username and password are my Gmail id password, through which I am sending mail, right? The error I am getting Execute failed: Error while communicating with the smtp server: javax.mail.AuthenticationFailedException Can someone pl…

But if I am not wrong, access through “Less secure apps” is not available anymore with Gmail.

> **[Less secure apps & your Google Account - Google Account Help](https://support.google.com/accounts/answer/6010255?hl=en)**
>
> To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your use

 ![immagine](https://forum-cdn.knime.com/uploads/default/original/3X/9/e/9e430979d1923921b9896bd22d2642e82fe9f50d.png)

Try with another provider. I use outlook, and it works.

Have a nice day,  
Raffaello Barri  
[LinkedIn](https://www.linkedin.com/in/raffaellobarri/)

---

<div class="post-metadata">

**Author:** ![tobias.koetter](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tobias.koetter/32/56844_2.png) [@tobias.koetter](https://forum.knime.com/u/tobias.koetter)\
**Post date:** [November 15, 2023, 11:58am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/3 "2023-11-15T11:58:19Z")

</div>

Hello @lelloba ,  
instead of your regular password you can use an App password. Please follow this [instruction](https://support.google.com/mail/answer/185833?hl=en) to create a new App password.  
Once created use the App password instead of your standard password in the password field as shown here:

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/2/52b45f66292cfe10666b9e63bc5b6632b832d811.png)

Bye  
Tobias

---

<div class="post-metadata">

**Author:** ![lelloba](https://forum-cdn.knime.com/user_avatar/forum.knime.com/lelloba/32/43992_2.png) [@lelloba](https://forum.knime.com/u/lelloba)\
**Post date:** [November 17, 2023, 8:10am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/4 "2023-11-17T08:10:52Z")

</div>

Nice @tobias.koetter! Thank you 🙂

Raffaello

---

<div class="post-metadata">

**Author:** ![s.roughley](https://forum-cdn.knime.com/user_avatar/forum.knime.com/s.roughley/32/366_2.png) [@s.roughley](https://forum.knime.com/u/s.roughley)\
**Post date:** [January 24, 2024, 5:32pm UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/5 "2024-01-24T17:32:52Z")

</div>

Hi Tobias,

Thanks for this. Unfortunately, when I try this the Send Email node fails with the error message:

`ERROR Send Email 3:1 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`

The version in the KNIME Log is longer but not much more (if any!) informative:

```auto
2024-01-24 17:28:46,493 : ERROR : KNIME-Worker-15-Send Email 3:1 : : Node : Send Email : 3:1 : 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
org.knime.core.node.InvalidSettingsException: 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
	at org.knime.base.node.util.sendmail.SendMailConfiguration.send(SendMailConfiguration.java:680)
	at org.knime.base.node.util.sendmail.SendMailConfiguration.send(SendMailConfiguration.java:659)
	at org.knime.base.node.util.sendmail.SendMailNodeModel.execute(SendMailNodeModel.java:95)
	at org.knime.core.node.NodeModel.executeModel(NodeModel.java:549)
	at org.knime.core.node.Node.invokeFullyNodeModelExecute(Node.java:1267)
	at org.knime.core.node.Node.execute(Node.java:1041)
	at org.knime.core.node.workflow.NativeNodeContainer.performExecuteNode(NativeNodeContainer.java:595)
	at org.knime.core.node.exec.LocalNodeExecutionJob.mainExecute(LocalNodeExecutionJob.java:98)
	at org.knime.core.node.workflow.NodeExecutionJob.internalRun(NodeExecutionJob.java:201)
	at org.knime.core.node.workflow.NodeExecutionJob.run(NodeExecutionJob.java:117)
	at org.knime.core.util.ThreadUtils$RunnableWithContextImpl.runWithContext(ThreadUtils.java:367)
	at org.knime.core.util.ThreadUtils$RunnableWithContext.run(ThreadUtils.java:221)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
	at org.knime.core.util.ThreadPool$MyFuture.run(ThreadPool.java:123)
	at org.knime.core.util.ThreadPool$Worker.run(ThreadPool.java:246)
Caused by: 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
	at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2140)
	at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:734)
	at javax.mail.Service.connect(Service.java:342)
	at javax.mail.Service.connect(Service.java:222)
	at javax.mail.Service.connect(Service.java:243)
	at org.knime.base.node.util.sendmail.SendMailConfiguration.sendMail(SendMailConfiguration.java:856)
	at org.knime.base.node.util.sendmail.SendMailConfiguration.send(SendMailConfiguration.java:674)
	... 15 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.fatal(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(Unknown Source)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(Unknown Source)
	at java.base/sun.security.ssl.SSLHandshake.consume(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.TransportContext.dispatch(Unknown Source)
	at java.base/sun.security.ssl.SSLTransport.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.decode(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
	at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:602)
	at com.sun.mail.util.SocketFetcher.startTLS(SocketFetcher.java:529)
	at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTransport.java:2135)
	... 21 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 java.base/sun.security.validator.PKIXValidator.doBuild(Unknown Source)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
	at java.base/sun.security.validator.Validator.validate(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(Unknown Source)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown Source)
	... 36 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(Unknown Source)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown Source)
	at java.base/java.security.cert.CertPathBuilder.build(Unknown Source)
	... 41 more

```

Steve

---

<div class="post-metadata">

**Author:** ![tqAkshay95](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tqakshay95/32/67469_2.png) [@tqAkshay95](https://forum.knime.com/u/tqAkshay95)\
**Post date:** [January 31, 2024, 10:02am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/6 "2024-01-31T10:02:51Z")

</div>

Hello @lelloba ,

It seems like there might be an issue with your SMTP settings for the “Send Email” node. Please check the following settings:

SMTP Host:  
Ensure that the SMTP host is set to “[smtp.com](http://smtp.com)” without any extra characters or spaces.

SMTP Port:  
Use port 587 for TLS or port 465 for SSL. In your case, it seems you’ve set it to 587, which is correct.

From Email:  
Make sure you’ve provided a valid email address in the “From Email” field.

User Name and Password:  
Check if the username and password for your Gmail account are correctly entered.  
Ensure there are no typos or spaces.

---

<div class="post-metadata">

**Author:** ![lelloba](https://forum-cdn.knime.com/user_avatar/forum.knime.com/lelloba/32/43992_2.png) [@lelloba](https://forum.knime.com/u/lelloba)\
**Post date:** [February 6, 2024, 10:50am UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/7 "2024-02-06T10:50:50Z")

</div>

Hello @tqAkshay95 ,

did you mean to tag @Lee_Po4?

Have a nice day,  
Raffaello

---

<div class="post-metadata">

**Author:** ![tqAkshay95](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tqakshay95/32/67469_2.png) [@tqAkshay95](https://forum.knime.com/u/tqAkshay95)\
**Post date:** [February 6, 2024, 1:36pm UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/8 "2024-02-06T13:36:10Z")

</div>

Hello @lelloba,

Yes, actually I intended to tag @Lee_Po4.

Have a nice day,

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [May 6, 2024, 1:37pm UTC](https://forum.knime.com/t/how-to-use-the-send-mail-node/75072/9 "2024-05-06T13:37:07Z")

</div>

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