# send email

<div align="left"><img src="https://111806075-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg4otljWU9FsHKYhTsW%2Fuploads%2FOwwygKnxS4UqZW1hM6Om%2Fimage.png?alt=media&#x26;token=5245d323-6f1d-4ae1-8d3a-7e0f983b6b67" alt=""></div>

Node sends incoming message using configured Mail Server. This Node works only with messages that where created using [**To Email**](https://docs.tesenso.com/tesenso-iot-cloud/rule-engine/rule-engine/transformation-rule-nodes/to-email-transformation) transformation Node, please connect this Node with [**To Email**](https://docs.tesenso.com/tesenso-iot-cloud/rule-engine/rule-engine/transformation-rule-nodes/to-email-transformation) Node using **Success** chain.

{% hint style="success" %}
to send email you have **two options**:&#x20;

* use the preconfigured Tesenso email service without any configuration effort&#x20;
* or set up your own email service using send grid.
  {% endhint %}

{% tabs %}
{% tab title="use Tesenso email service" %}
![](https://111806075-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mg4otljWU9FsHKYhTsW%2Fuploads%2FXyII7Adtb98dPxVy1U4Q%2Fimage.png?alt=media\&token=4de04e70-a0c6-4f6d-bc00-f7e85bae9533)
{% endtab %}

{% tab title="setup your own email service" %}
**Configuration:**

![image](https://thingsboard.io/images/user-guide/rule-engine-2-0/nodes/external-send-email-config.png)

* **Use system SMTP settings** - if enabled default Mail Server configured on System level will be used
* **Protocol** - Mail Server transport protocol: *SMTP* or *SMTPS*
* **SMTP host** - Mail Server host
* **SMTP port** - Mail Server port
* **Timeout ms** - read timeout in milliseconds
* **Enable TLS** - if true, enables the use of the STARTTLS command (if supported by the server)
* **Username** - username for the account at the mail host, if any
* **Password** - password for the account at the mail host, if any

&#x20;
{% endtab %}
{% endtabs %}

Additionally this node can create email attachments if incoming message has prepared **attachments** metadata field with reference to files stored in DataBase.

Multiple attachments supported. Use a comma separated no whitespace references (uuids) to send many files. Here an example of message **metadata**:

```
{
  "attachments": "e18b6950-dfca-11eb-affb-8db134b46d68,17383b4c-6000-4bb8-be04-b1cb15aa18c5"
}
```

In case of successful mail sending, original Message will be passed to the next nodes via **Success** chain, otherwise **Failure** chain is used.
