How to send email with SMTP
Knock supports sending email notifications to your users via the Simple Mail Transfer Protocol (SMTP). In this configuration, Knock will act as an SMTP client and send email notifications to a specified SMTP server.
In this guide, we'll cover how to get started sending email notifications using SMTP with Knock.
Features
- Attachments support
- Link and open tracking
- Per environment configuration
- Sandbox mode
Getting started
You can create a new SMTP Relay channel in the dashboard under the Integrations > Channels section. From there, you'll need to configure the channel for each environment you have.
The following information is required to configure an SMTP Relay channel:
- SMTP server host
- SMTP server port
- Username
- Password
Please note the following:
- Knock only supports authenticated SMTP connections.
- The port must support TLS. Email providers commonly use port 587 for TLS, but check your provider's documentation to confirm.
- We cannot currently track deliverability through SMTP Relay channels. This means that all notifications sent via SMTP will show up as "Sent" in the Knock messages log, but not "Delivered."
Provider configuration
Environment default settings
The following fields are optional and, if set, will be applied to all email messages sent via this channel within the environment:
Setting SMTP headers
For SMTP Relay channels, the JSON overrides field can be used to set SMTP headers. Overrides can be set in either the environment settings or per template.
Knock supports overriding existing SMTP headers and adding custom headers.
Headers must be nested under the headers
key. Other keys will be ignored.
Recipient data requirements
In order to send an email notification you'll need a valid email
property set on your recipient.