How to use an SMTP relay for reliable delivery
Updated 11/29/2026
An SMTP relay is a service your app sends email through, instead of sending directly. The service has IPs with good reputation, so messages reach the inbox.
When it is worth it
- You only send transactional emails (confirmations, resets) and do not want to run a full mail server.
- Port 25 is blocked or your IP has no reputation.
- You need reliable delivery for large volumes.
How it works
You configure the app to send through the relay's SMTP server, with a username and password:
MAIL_HOST=smtp.relay-service.com
MAIL_PORT=587
MAIL_USERNAME=your_key
MAIL_PASSWORD=your_secret
MAIL_ENCRYPTION=tls
Configure DNS
The relay usually asks you to add SPF and DKIM records so it can send on behalf of your domain, see SPF, DKIM and DMARC.
Your own relay
You can also run your own relay with Postfix on a server dedicated to sending, separating reputation from the main app. To receive email, you still need a full mail server.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Newsletters with Listmonk: lists, campaigns and delivery
Send newsletters from your own server with no per-subscriber fee: SMTP, lists, signup forms, campaigns and domain reputation.
Updated 11/29/2026EmailShould you run your own mail server?
The pros, cons and what you need to know before hosting email on your own server.
Updated 11/29/2026EmailHow to secure a mail server
A misconfigured mail server becomes a spam source. Here are the essential security rules.
Updated 11/29/2026