open connection

This block is part of the smtp group and was last modified in core v15.0.1.

open connection v15.0.1

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.

In pins 8 + flow
  • 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

Out pins 3 + flow
  • 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: a function trigger starts the flow; value feeds the host pin; the flow out pin feeds debug.

Studio canvas example for the open connection block: typical wiring for open connection.

Version history

Introduced in v15.0.1.


Back to smtp Return to the main group to view all sub-groups Back to smtp Return to the group to view all blocks within this group