---
title: "open connection · RUAL Documentation"
description: "Opens an SMTP connection to a relay or submission host. Nothing is sent until smtp send email runs; with verify on, the block dials the host once (EHLO,…"
canonical: https://docs.rual.nl/block-types/smtp/smtpconnection_open
language: en
---

[Cluster](https://docs.rual.nl/cluster)

[Blocks](https://docs.rual.nl/block-types)

[Interfaces](https://docs.rual.nl/interfaces)

[Blueprints](https://docs.rual.nl/blueprints)

[Blueprint Language](https://docs.rual.nl/engine)

[Tutorials](https://docs.rual.nl/tutorials)

[Home automation](https://docs.rual.nl/home-automation)

[Examples](https://docs.rual.nl/examples)

[Reference](https://docs.rual.nl/reference)

[Architecture](https://docs.rual.nl/architecture)

[Troubleshooting](https://docs.rual.nl/troubleshooting)

Other

# open connection

This block is part of the [`smtp`](https://docs.rual.nl/block-types/smtp) group and was last modified in core [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

Opens an SMTP connection to a relay or submission host. Nothing is sent until `smtp send email` runs; with `verify` on, the block dials the host once (EHLO, STARTTLS, AUTH, QUIT) so the flow can branch on `success` before composing a message.

- flow `flow`

- host required `value` Hostname or IP of the SMTP server, e.g. `mx1.mssgsmail.com`.

- port `number` TCP port. 587 for submission (STARTTLS), 465 for implicit TLS, 25 for relay.

Default `587`

- username `value` AUTH username. Leave empty for an unauthenticated relay.

- password `value` AUTH password. Stored on the connection and never logged.

- security `value` `starttls` (default), `tls` for implicit TLS, or `none` for an unencrypted connection (loopback / private addresses only). • Suggestions: `starttls` `tls` `none`

Default `starttls`

- timeout seconds `number` Dial and command timeout, in seconds.

Default `30`

- helo `value` EHLO name announced to the server. Defaults to this node's hostname.

- verify `condition` When on, dial the host once (EHLO, STARTTLS, AUTH, QUIT) and report the result on `success`. Off by default : opening a connection otherwise makes no network call.

Default `false`

- flow `flow`

- success `condition`

- error `value`

- connection `smtpconnection`

Builds an SMTP connection object from host/port/credentials and outputs it on the connection pin. security: 'starttls' (default) upgrades a plain connection with STARTTLS and REQUIRES the upgrade to succeed; 'tls' dials implicit TLS (port 465); 'none' sends in the clear and is refused for any host that is not loopback or a private address. verify=false (the default) makes NO network call : it only assembles the object, so success is true whenever host is set. verify=true dials the host and reports reachability plus authentication on success/error. The connection carries the password and must never be logged or written to a document. In a simulation the verify probe is skipped and no packet leaves the node.

| `smtp` |
| --- |
| `mta` |
| `relay` |
| `submission` |

A typical wiring for [open connection](https://docs.rual.nl/block-types/smtp/smtpconnection_open): a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function) starts the flow; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `host` pin; the `flow` out pin feeds [debug](https://docs.rual.nl/block-types/state%2520ui/state_debug).

[![Studio canvas example for the open connection block: typical wiring for open connection.](https://docs.rual.nl/canvas-examples/smtpconnection_open.png)](https://docs.rual.nl/canvas-examples/smtpconnection_open.png?v=3)

## Version history

Introduced in [`v15.0.1`](https://docs.rual.nl/core-versions/150001).

- [Back to `smtp`](https://docs.rual.nl/block-types/smtp): Return to the main group to view all sub-groups

- [Back to `smtp`](https://docs.rual.nl/block-types/smtp?group=smtp): Return to the group to view all blocks within this group

Was this page helpful? [Tell us what to improve](https://docs.rual.nl/support) · RUAL Docs is an integral component of the [RUAL ecosystem](https://rual.nl)
