send email

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

send email v15.0.1

Builds an RFC 5322 message and hands it to the SMTP server on the connection. Use this to deliver through your own MTA (Exim, Postfix) rather than a hosted API.

In pins 14 + flow
  • flow
    flow
  • connection required
    smtpconnection
  • from required
    value

    Envelope and header sender. Either a bare address or "Name" <email@example.com>.

  • to required
    array

    Recipient addresses.

  • cc
    array

    Copy recipients. In the headers and in the envelope.

  • bcc
    array

    Blind copy recipients. In the envelope only : never written to the headers.

  • reply to
    value

    Reply-To header.

  • subject required
    value

    Subject header. RFC 2047 encoded when it is not plain ASCII.

  • html
    value

    HTML body.

  • text version
    value

    Plain-text body. Derived from the HTML by stripping tags when left empty.

  • headers
    object

    Extra headers, e.g. In-Reply-To, References, List-Unsubscribe, X-Mailer. From, To, Bcc and Message-ID are refused : the last because the message_id pin is what the message_id out-pin reports.

  • message id
    value

    Message-ID to use. Minted as <uuid@domain-of-from> when empty. Refused when it holds whitespace, control characters or angle brackets other than a surrounding pair.

  • attachments
    array

    { name, content_type, content_base64 } or { name, content_type, path } : a path is read from the entity's own file storage.

  • attachment
    file

    File pin attachments, the same shape the postmark and lettermint blocks take.

  • inline images
    array

    { cid, content_type, content_base64 } : referenced from the HTML as cid:<cid>.

Out pins 5 + flow
  • flow
    flow
  • connection
    smtpconnection
  • success
    condition
  • error
    value
  • message id
    value
  • response
    object

Composes a complete MIME message and submits it over SMTP. Body structure is chosen from what is filled: text+html become multipart/alternative, inline_images wrap that in multipart/related, attachments wrap the result in multipart/mixed, and a single body alone is sent as one part. text is derived from html by stripping tags when the text pin is empty. Non-ASCII header values are RFC 2047 encoded; bodies are quoted-printable or base64 so the wire stays 7-bit safe; lines end CRLF. The ENVELOPE is from + to + cc + bcc; Bcc never appears in the headers, and the headers pin refuses From/To/Bcc/Message-ID overrides (Message-ID comes from the message_id pin only, so the message_id out-pin always reports the delivered id). Every header value is sanitized against line breaks; message_id, an inline image cid and an address net/mail could not parse are refused outright when they hold whitespace, control characters or angle brackets. message_id is minted as <uuid@domain-of-from> when the pin is empty and is always reported on the message_id out-pin. Suppressed in simulation: a dry-run never sends.

smtp
mta
relay
send mail

A typical wiring for send email: a function trigger starts the flow; open connection feeds the connection pin; value feeds the from pin; with values feeds the array_to pin; value feeds the subject pin; the flow out pin feeds debug.

Studio canvas example for the send email block: typical wiring for send email.

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