SMTP binding spec

Detailed documentation on the SMTP binding component

Component format

To setup SMTP binding create a component of type bindings.smtp. See this guide on how to create and apply a binding configuration.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: smtp
  namespace: default
spec:
  type: bindings.smtp
  version: v1
  metadata:
  - name: host
    value: "smtp host"
  - name: port
    value: "smtp port"
  - name: user
    value: "username"
  - name: password
    value: "password"
  - name: skipTLSVerify
    value: true|false
  - name: emailFrom
    value: "sender@example.com"
  - name: emailTo
    value: "receiver@example.com"
  - name: emailCC
    value: "cc@example.com"
  - name: emailBCC
    value: "bcc@example.com"
  - name: subject
    value: "subject"

Spec metadata fields

FieldRequiredBinding supportDetailsExample
hostYOutputThe host where your SMTP server runs"smtphost"
portYOutputThe port your SMTP server listens on"9999"
userYOutputThe user to authenticate against the SMTP server"user"
passwordYOutputThe password of the user"password"
skipTLSVerifyNOutputIf set to true, the SMPT server’s TLS certificate will not be verified. Defaults to "false""true", "false"
emailFromNOutputIf set, this specifies the email address of the sender. See also"me@example.com"
emailToNOutputIf set, this specifies the email address of the receiver. See also"me@example.com"
emailCcNOutputIf set, this specifies the email address to CC in. See also"me@example.com"
emailBccNOutputIf set, this specifies email address to BCC in. See also"me@example.com"
subjectNOutputIf set, this specifies the subject of the email message. See also"subject of mail"

Binding support

This component supports output binding with the following operations:

  • create

Example request

You can specify any of the following optional metadata properties with each request:

  • emailFrom
  • emailTo
  • emailCC
  • emailBCC
  • subject

When sending an email, the metadata in the configuration and in the request is combined. The combined set of metadata must contain at least the emailFrom, emailTo and subject fields.

The emailTo, emailCC and emailBCC fields can contain multiple email addresses separated by a semicolon.

Example:

{
  "operation": "create",
  "metadata": {
    "emailTo": "dapr-smtp-binding@example.net",
    "emailCC": "cc1@example.net; cc2@example.net",
    "subject": "Email subject"
  },
  "data": "Testing Dapr SMTP Binding"
}

The emailTo, emailCC and emailBCC fields can contain multiple email addresses separated by a semicolon.