SMTP Relay
The SMTP Relay feature enables you to send emails through your own SMTP server. This is particularly useful if you need to send emails from clients that do not natively support the Sendlix API. The SMTP Relay acts as a translation layer, converting the SMTP protocol to the Sendlix API. This allows you to send emails from any SMTP client, such as Outlook, Thunderbird, or other email clients that support SMTP.
The SMTP Relay is an open-source project licensed under AGPL-3.0. You can find the source code on GitHub.
Getting Started with SMTP Relay
You have two options for sending emails with the SMTP protocol:
- Using the Sendlix SMTP Relay
- Utilize the hosted Sendlix SMTP relay service. This is the simplest way to get started and requires no additional setup. However, it requires a Plus plan.
- Deploy your own SMTP server:
- Deploy your own SMTP Relay server. This option does not require a Plus plan and offers powerful relay capabilities with high throughput.
The Sendlix SMTP Relay
To log in to the Sendlix SMTP Relay, use the following credentials:
- Username:
X-API-KEY
- Password: Your Sendlix API key
In the username field, you can append category=your-category
to assign emails to a specific category. This is useful for tracking and organizing your emails. Separate the username and category with a semicolon ;
, like this:
X-API-KEY;category=your-category
Using the Sendlix SMTP Relay
The hosted Sendlix SMTP Relay is ideal if you need a quick start and cannot deploy your own SMTP server.
SMTP Relay Configuration
- SMTP Server:
smtp.sendlix.com
- SMTP Port:
587
(TLS) - SMTP Security:
TLS
Deploying Your Own SMTP Relay
Deploying your own SMTP Relay server is beneficial if you require high throughput.
Docker
The recommended method for deploying the SMTP Relay is using Docker. Use the following command to run the SMTP Relay:
docker run -p 587:587 ghcr.io/sendlix/smtp-relay/sendlix-smtp-relay:latest
Building from Source
Prerequisites
- .NET 9 or later
Steps
-
Download Obtain the latest version of the Sendlix SMTP Relay.
-
Extract Unpack the downloaded file into a directory of your choice.
-
Configure Configure the relay using environment variables (refer to the Configuration section).
Configuration
You can configure the SMTP Relay using environment variables. The following environment variables are available:
The Sendlix SMTP Relay can be configured using environment variables. All settings are optional. The available options are:
ListenAddress
: The IP address the relay binds to (default:127.0.0.1
).Port
: The port the relay listens on (default:587
).ServerCertificatePath
: Path to an SSL certificate in PKCS12 format (optional).Auth:Username
: Username for Sendlix API authentication.Auth:ApiKey
: API key for Sendlix API authentication.Auth:ApiKeyPath
: Path to a file containing the API key (alternative toAuth:ApiKey
).
The Auth:*
settings allow you to define default credentials for the relay. This enables clients to send emails without authenticating, as the relay handles authentication with Sendlix on their behalf.