Configuring the SMTP Server Using REST API
Learn how to configure an SMTP server using REST API.
Table of Contents
Overview
Configuring the SMTP server determines the mail server and account that will be used to generate the global email notifications. Once you add the information, you can test the connection to ensure no additional settings need to be added for the notifications to work.
DryvIQ uses MailKit, which includes a default server certificate validation for a list of commonly used mail servers such as gmail.com, outlook.com, mail.me.com, yahoo.com, and gmx.net.
Notifications cannot be set up on an SMTP server that has an untrusted SSL certificate. The environment where DryvIQ is running needs to trust the certificate. This can be done by manually trusting the certificate or using a valid self-signed certificate.
Field | Description | Required |
---|---|---|
host | This is the fully qualified domain name of the SMTP service. | Required |
port | In most cases, the SMTP service port will be port 587; however, ports 25 or 465 may be utilized but are not preferred. For more information on SMTP ports, see here: https://www.socketlabs.com/blog/what-port-does-smtp-use/ | |
socketoptions |
Add the value that corresponds to the encryption to be used:
|
Optional (If no value is set, -1 will be set.) |
from | The default sender. If not specified, the username will be used. | Required if a username is not provided. |
username | The STMP server username. This could be your email address depending on the service. | Required if your mail server requires authentication. |
password | The SMTP service password. This could be your email address depending on the service. | Required if your mail server requires authentication. |
type | Should be smtp-configuration. |
Configure the SMTP Server
Execute a PATCH to configure the email handler to receive notifications. This request configuration will persist. To execute a test, which will not persist, see Send a Test Email Notification | REST API.
PATCH {{url}}v1/notifications/handlers/email
Example Body
{
"from": "string",
"host": "string",
"links": {
"{name}": {
"href": "string",
"method": "string",
"title": "string"
}
},
"password": "string",
"port": 587,
"socketoptions": -1,
"type": "smtp-configuration",
"username": "string"
}